Compare commits

..

No commits in common. "master" and "hotfixbug" have entirely different histories.

97 changed files with 12434 additions and 19060 deletions

69
App.vue
View File

@ -9,11 +9,8 @@
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// #ifdef APP-PLUS // #ifdef APP-PLUS
import { import { initEvent } from "@/utils/uniMPevent.js";
initEvent
} from "@/utils/uniMPevent.js";
let jpushModule = uni.requireNativePlugin("JG-JPush"); let jpushModule = uni.requireNativePlugin("JG-JPush");
import uniMP from '@/utils/uniMP.js';
// #endif // #endif
import { import {
checkLogin checkLogin
@ -31,7 +28,6 @@
data(){ data(){
return { return {
audioTeam: [], audioTeam: [],
timer: null
} }
}, },
globalData: { globalData: {
@ -110,13 +106,32 @@
// 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
let messageID = result.messageID let messageID = result.messageID
let title = result.title let title = result.title
let content = result.content let content = result.content
let extras = result.extras.type 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')
@ -147,22 +162,12 @@
// this.audioTeam.push(result.extras.type); // this.audioTeam.push(result.extras.type);
// } // }
} }
console.log("收到消息")
console.log(result)
// //
if (notificationEventType == 'notificationOpened') { if (notificationEventType == 'notificationOpened') {
if (result.extras.type == 2) {
let data = result.extras.group_data
data.route = result.extras.route
data.type = 2
uniMP.loadAppletMP(data)
} else {
uni.navigateTo({ uni.navigateTo({
url: result.extras.route url: result.extras.route
}) })
} }
}
}) })
// jpushModule.addCustomMessageListener(result => { // jpushModule.addCustomMessageListener(result => {
@ -280,24 +285,37 @@
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
@ -305,17 +323,25 @@
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
} }
} }
}) })
} }
}) })
}, },
/** /**
* 语音播报 * 语音播报
@ -562,9 +588,4 @@
/deep/.swiper.dot2 .wx-swiper-dots { /deep/.swiper.dot2 .wx-swiper-dots {
right: 130rpx; right: 130rpx;
} }
* {
scrollbar-color: #ffffff #f7f7f9;
scrollbar-width: thin;
}
</style> </style>

View File

@ -9,14 +9,6 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
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

@ -28,11 +28,6 @@ export function getProductParmas(id, data) {
noAuth: true noAuth: true
}); });
} }
export function getUnimpInfo() {
return request.get('intention/publish');
}
/** /**
* 获取店铺推荐商品 * 获取店铺推荐商品
* @param int id * @param int id
@ -305,19 +300,6 @@ 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
@ -572,17 +554,6 @@ export function getParmasValue(id) {
noAuth: true noAuth: true
}); });
} }
/**
* 获取参数值列表
* @param int id
*
*/
export function getIntention(uid) {
return request.get(`intention/info/${uid}`);
}
/** /**
* 到货通知 * 到货通知
* *
@ -685,11 +656,3 @@ export function getVillageInfo(data) {
noAuth: true noAuth: true
}); });
} }
/*
获取店铺资质
*/
export function consultApi(data) {
return request.post(`service/consult`, data)
}

View File

@ -117,17 +117,6 @@ export function registerForget(data) {
noAuth: true noAuth: true
}); });
} }
/**
* 一键登录
*/
export function phonelogin(data) {
return request.post("auth/phonelogin", data, {
noAuth: true
});
}
/** /**
* 获取用户中心菜单 * 获取用户中心菜单
* *
@ -270,13 +259,6 @@ export function extractCash(data) {
export function getAdminApplyAPI(merId, data) { export function getAdminApplyAPI(merId, data) {
return request.get(`admin/${merId}/apply`, data); return request.get(`admin/${merId}/apply`, data);
} }
/**
* 新商户
*/
export function isNewMer(uid, mer_id, data) {
return request.post(`auth/guide/${uid}/${mer_id}`, data);
}
/** /**
* 提现银行/提现最低金额 * 提现银行/提现最低金额
* *

View File

@ -1,11 +1,9 @@
<template> <template>
<view :style="viewColor"> <view :style="viewColor">
<view class="product-window" <view class="product-window" :class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'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 : ''" <image :src="(attr.productSelect&&attr.productSelect.image) ? attr.productSelect.image : ''" @click="loookImg"></image>
@click="loookImg"></image>
</view> </view>
<view class="text"> <view class="text">
<view class="line1"> <view class="line1">
@ -15,8 +13,7 @@
<view> <view>
预售价 预售价
<text class="num">{{ attr.productSelect.price }}</text> <text class="num">{{ attr.productSelect.price }}</text>
<text v-if="presell_type === 2">定金<text <text v-if="presell_type === 2">定金¥<text class="num">{{ attr.productSelect.down_price }}</text></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>
@ -25,12 +22,11 @@
<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" <view v-if="attr.productSelect && attr.productSelect.svip_price" class="acea-row row-middle">
class="acea-row row-middle"> <text class='vip-money'>{{attr.productSelect.svip_price}}</text>
<!-- <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>
@ -46,8 +42,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' : ''" <view class="itemn" :class="item.index === itemn.attr ? 'on' : ''" v-for="(itemn, indexn) in item.attr_value"
v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)" :key="indexn"> @click="tapAttr(indexw, indexn)" :key="indexn">
{{ itemn.attr }} {{ itemn.attr }}
</view> </view>
</view> </view>
@ -71,12 +67,8 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { import { mapGetters } from "vuex";
mapGetters import { HTTP_REQUEST_URL } from '@/config/app';
} from "vuex";
import {
HTTP_REQUEST_URL
} from '@/config/app';
export default { export default {
computed: mapGetters(['viewColor']), computed: mapGetters(['viewColor']),
props: { props: {
@ -122,7 +114,8 @@
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
} }
}, },
mounted() {}, mounted(){
},
methods: { methods: {
// //
loookImg(){ loookImg(){
@ -179,89 +172,72 @@
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;
@ -269,27 +245,22 @@
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;
@ -298,13 +269,11 @@
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;
@ -317,17 +286,14 @@
-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;
@ -337,34 +303,28 @@
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;
@ -374,12 +334,10 @@
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,15 +3,12 @@
<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":""' <view class='item acea-row row-between-wrapper' :class='active==index?"t-color":""' v-for="(item,index) in addressList"
v-for="(item,index) in addressList" @tap='tapAddress(index,item.address_id)' :key='index'> @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 <view class='name' :class='active==index?"t-color":""'>{{item.real_name}}<text class='phone'>{{item.phone}}</text></view>
class='phone'>{{item.phone}}</text></view> <view class='line1'>{{item.province}}{{item.city}}{{item.district}}{{item.street || ''}}{{item.detail}}</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>
@ -37,15 +34,9 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { import { getAddressList } from '@/api/user.js';
getAddressList import { mapGetters } from "vuex";
} from '@/api/user.js'; import { HTTP_REQUEST_URL } from '@/config/app';
import {
mapGetters
} from "vuex";
import {
HTTP_REQUEST_URL
} from '@/config/app';
export default { export default {
props: { props: {
pagesUrl: { pagesUrl: {
@ -96,7 +87,7 @@
let that = this; let that = this;
getAddressList({ getAddressList({
page: 1, page: 1,
limit: 100 limit: 5
}).then(res => { }).then(res => {
let addressList = res.data.list; let addressList = res.data.list;
// //
@ -123,11 +114,9 @@
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;
@ -136,18 +125,15 @@
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;
@ -156,32 +142,26 @@
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;
@ -194,21 +174,16 @@
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;
} }

View File

@ -3,7 +3,8 @@
<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" @click="goRouter(item)"> <view class="foot-item" v-for="(item,index) in newData.menuList" :key="index"
@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}}
@ -64,6 +65,7 @@
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -83,11 +85,9 @@
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,7 +95,6 @@
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;
@ -112,14 +111,12 @@
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

@ -4,10 +4,8 @@
: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" <view class="loadfail-img" v-else-if="isLoadError" :style="{ 'background-image': `url(${domain}/static/images/loadfail.png)`}"></view>
:style="{ 'background-image': `url(${domain}/static/easy-loadimage/loadfail.png)`}"></view> <view :class="['loading-img','spin-circle',loadingMode]" v-show="!showImg&&!isLoadError" :style="{ 'background-image': `url(${domain}/static/images/loading.gif)`}"></view>
<view :class="['loading-img','spin-circle',loadingMode]" v-show="!showImg&&!isLoadError"
:style="{ 'background-image': `url(${domain}/static/easy-loadimage/loading.gif)`}"></view>
</view> </view>
</template> </template>
<script> <script>
@ -20,19 +18,14 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { import { throttle } from '@/libs/uniApi';
throttle import { HTTP_REQUEST_URL } from '@/config/app';
} from '@/libs/uniApi';
import {
HTTP_REQUEST_URL
} from '@/config/app';
// id // id
function generateUUID() { function generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {     return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
let r = Math.random() * 16 | 0,         let r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
v = c == 'x' ? r : (r & 0x3 | 0x8);         return v.toString(16);
return v.toString(16);     })
})
} }
export default{ export default{
props:{ props:{
@ -122,7 +115,6 @@
image{ image{
will-change: transform will-change: transform
} }
/* 渐变过渡效果处理 */ /* 渐变过渡效果处理 */
image.origin-img{ image.origin-img{
width: 100%; width: 100%;
@ -130,16 +122,13 @@
opacity: 0.3; opacity: 0.3;
max-height: 360rpx; max-height: 360rpx;
} }
image.origin-img.show-transition{ image.origin-img.show-transition{
transition: opacity .5s; transition: opacity .5s;
opacity: 1; opacity: 1;
} }
image.origin-img.no-transition{ image.origin-img.no-transition{
opacity: 1; opacity: 1;
} }
/* 加载失败、加载中的占位图样式控制 */ /* 加载失败、加载中的占位图样式控制 */
.loadfail-img{ .loadfail-img{
height: 100%; height: 100%;
@ -147,38 +136,25 @@
background-size: 50%; background-size: 50%;
background-position: center; background-position: center;
} }
.loading-img{ .loading-img{
height: 100%; height: 100%;
background-position: center; background-position: center;
} }
/* 转圈 */ /* 转圈 */
.spin-circle{ .spin-circle{
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 60%; background-size: 60%;
} }
/* 动态灰色若隐若现 */ /* 动态灰色若隐若现 */
.looming-gray{ .looming-gray{
animation: looming-gray 1s infinite linear; animation: looming-gray 1s infinite linear;
background-color: #e3e3e3; background-color: #e3e3e3;
} }
@keyframes looming-gray{ @keyframes looming-gray{
0% { 0% {background-color:#e3e3e3aa;}
background-color: #e3e3e3aa; 50% {background-color:#e3e3e3;}
100% {background-color:#e3e3e3aa;}
} }
50% {
background-color: #e3e3e3;
}
100% {
background-color: #e3e3e3aa;
}
}
/* 骨架屏1 */ /* 骨架屏1 */
.skeleton-1{ .skeleton-1{
background-color: #e3e3e3; background-color: #e3e3e3;
@ -188,13 +164,11 @@
background-position:0 0; background-position:0 0;
animation: skeleton-1 .6s infinite; animation: skeleton-1 .6s infinite;
} }
@keyframes skeleton-1 { @keyframes skeleton-1 {
to { to {
background-position: 200% 0; background-position: 200% 0;
} }
} }
/* 骨架屏2 */ /* 骨架屏2 */
.skeleton-2{ .skeleton-2{
background-image: linear-gradient(-90deg, #fefefe 0%, #e6e6e6 50%,#fefefe 100%); background-image: linear-gradient(-90deg, #fefefe 0%, #e6e6e6 50%,#fefefe 100%);
@ -202,10 +176,10 @@
background-position:0 0; background-position:0 0;
animation: skeleton-2 1.2s ease-in-out infinite; animation: skeleton-2 1.2s ease-in-out infinite;
} }
@keyframes skeleton-2{ @keyframes skeleton-2{
to { to {
background-position: -135% 0; background-position: -135% 0;
} }
} }
</style> </style>

View File

@ -39,7 +39,7 @@
<view class="right-btn-box event_box"> <view class="right-btn-box event_box">
<view class="btn-item" <view class="btn-item"
v-if="evaluate != 2 && item.is_refund ==0 && pay_type!= 10 && status==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0" v-if="evaluate != 2 && item.is_refund ==0 && pay_type!= 10 && status==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0"
@click.stop="showTips=true,refundItem=item">申请退款</view> @click.stop="refund(item)">申请退款</view>
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x <view class="btn-item err" v-if="item.is_refund ==1">退款中 x
{{item.product_num - item.refund_num}} {{item.product_num - item.refund_num}}
</view> </view>
@ -113,7 +113,7 @@
</view> </view>
<view class="btn-item" <view class="btn-item"
v-if="evaluate != 2 && item.refund_switch==1 && pay_type!= 10 && status==0 && (item.is_refund == 0 && evaluate != 9 && orderData.refund_status || item.refund_num > 0)" v-if="evaluate != 2 && item.refund_switch==1 && pay_type!= 10 && status==0 && (item.is_refund == 0 && evaluate != 9 && orderData.refund_status || item.refund_num > 0)"
@click.stop="showTips=true,refundItem=item">申请退款</view> @click.stop="refund(item)">申请退款</view>
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0' <view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0'
@click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view> @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view> <view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
@ -121,22 +121,6 @@
</view> </view>
</view> </view>
</view> </view>
<u-overlay :show="showTips">
<view class="tips">
<view class="" style="font-size: 32rpx;">
温馨提示
</view>
<view class="">
下单后1小时内申请退款可极速退款
</view>
<u-button color="#61D137" text="我知道了" @tap="refund(refundItem)"></u-button>
</view>
</u-overlay>
</view> </view>
</template> </template>
@ -211,8 +195,6 @@
computed: mapGetters(['viewColor']), computed: mapGetters(['viewColor']),
data() { data() {
return { return {
showTips: false, //退
refundItem: null,
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
totalNmu: '', totalNmu: '',
isTimePay: false, // isTimePay: false, //
@ -263,8 +245,7 @@
let id = res.data.product_assist_set_id; let id = res.data.product_assist_set_id;
uni.hideLoading(); uni.hideLoading();
uni.navigateTo({ uni.navigateTo({
url: '/pages/activity/assist_detail/index?id=' + id + url: '/pages/activity/assist_detail/index?id=' + id + '&sale_type=' + this.sale_type
'&sale_type=' + this.sale_type
}); });
}).catch((err) => { }).catch((err) => {
uni.showToast({ uni.showToast({
@ -276,7 +257,6 @@
}, },
// 退 // 退
refund(item) { refund(item) {
if (this.showTips) this.showTips = false;
// #ifdef MP // #ifdef MP
openOrderRefundSubscribe().then(() => { openOrderRefundSubscribe().then(() => {
uni.hideLoading(); uni.hideLoading();
@ -301,14 +281,12 @@
if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) { if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' + '&ids=' + item url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' + '&ids=' + item
.order_product_id + '&refund_type=1&order_type=' + this.orderData.order_type + .order_product_id + '&refund_type=1&order_type=' + this.orderData.order_type + '&sale_type=' + this.sale_type
'&sale_type=' + this.sale_type
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/users/refund/select?order_id=' + this.orderId + '&type=1&order_type=' + this url: '/pages/users/refund/select?order_id=' + this.orderId + '&type=1&order_type=' + this
.orderData.order_type + '&ids=' + item.order_product_id + '&sale_type=' + this .orderData.order_type + '&ids=' + item.order_product_id + '&sale_type=' + this.sale_type
.sale_type
}) })
} }
// #endif // #endif
@ -481,21 +459,4 @@
background: #F0F0F0; background: #F0F0F0;
} }
} }
.tips {
width: 590rpx;
height: 354rpx;
background-color: white;
border-radius: 16rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
padding: 50rpx 40rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
</style> </style>

View File

@ -82,10 +82,6 @@
returnUrl: { returnUrl: {
type: String, type: String,
default: '' default: ''
},
sale_type: {
type: [Number,String],
default: 1
} }
}, },
data() { data() {
@ -239,7 +235,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=1&sale_type=' + that.sale_type url: goPages + '?status=1'
}); });
break; break;
case 'alipay': case 'alipay':
@ -271,7 +267,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + 'status=1&sale_type=' + that.saleType url: goPages + 'status=1'
}); });
}).catch(res => { }).catch(res => {
console.log('测试支付数据无效的catch' + res.data) console.log('测试支付数据无效的catch' + res.data)
@ -285,7 +281,7 @@
title: '取消支付' title: '取消支付'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=0&sale_type=' + that.sale_type url: goPages + '?status=0'
}); });
} }
} }
@ -310,7 +306,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + 'status=1&sale_type=' + that.sale_type url: goPages + 'status=1'
}); });
}, },
fail: (e) => { fail: (e) => {
@ -323,8 +319,7 @@
title: '取消支付' title: '取消支付'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=0&sale_type=' + that url: goPages + '?status=0'
.sale_type
}); });
} }
}, },
@ -359,8 +354,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=1&sale_type=' + that url: goPages + '?status=1'
.sale_type
}); });
return that.$util.Tips({ return that.$util.Tips({
@ -368,8 +362,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=1&sale_type=' + that url: goPages + '?status=1'
.sale_type
}); });
}, },
fail: function(e) { fail: function(e) {
@ -441,8 +434,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + 'status=1&sale_type=' + that url: goPages + 'status=1'
.sale_type
}); });
}, },

View File

@ -1,43 +1,45 @@
<template> <template>
<view class='product-bg'> <view class='product-bg'>
<swiper :indicator-dots="indicatorDots" :current='current' indicator-active-color="#e93323" :autoplay="autoplay" <swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay" :circular="circular"
:circular="circular" :interval="interval" :duration="duration" @change="change" v-if="isPlay"> :interval="interval" :duration="duration" @change="change" v-if="isPlay">
<!-- #ifndef APP-PLUS --> <!-- #ifndef APP-PLUS -->
<block v-for="(item,index) in imgUrls" :key='index'> <swiper-item v-if="videoline && videoline != '' && videoline != 'https:'">
<swiper-item v-if="isVideoUrl(item)"> <view class="item">
<video :src="isVideoUrl(item,true)" objectFit="cover" controls style="width:100%;height:100% " <video id="myVideo" :src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : ("http:" + videoline)'
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate objectFit="cover" controls style="width:100%;height:100% " show-mute-btn="true"
:enable-progress-gesture="false" :poster="item+coverUrl"></video> auto-pause-if-navigate @ended="endedFun()"></video>
</swiper-item> <view class="poster" v-if="controls">
<swiper-item v-else> <image class="image" :src="videoCoverImg"></image>
<image :src="item" class="slide-image" @click='getpreviewImage(item)' /> </view>
</swiper-item> <view class="stop" v-if="controls" @tap="bindPause">
</block> <image class="image" src="../../static/images/stop.png"></image>
<!-- #endif --> </view>
<!-- #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> </view>
</swiper-item> </swiper-item>
<!-- #endif -->
<swiper-item v-else> <!-- #ifdef APP-PLUS -->
<image :src="item" class="slide-image" @click='getpreviewImage(item)' /> <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'>
<swiper-item>
<image :src="item" class="slide-image" @click='getpreviewImage(item)' mode="widthFix" />
</swiper-item> </swiper-item>
</block> </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='playingUrl' objectFit="cover" controls style="width:100%;height:100% " <video id="myVideo" :src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : "http:" + videoline'
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate :enable-progress-gesture="false" objectFit="cover" controls style="width:100%;height:100% " show-center-play-btn show-mute-btn="true"
:poster="playingUrl+coverUrl" @pause="videoPause" @ended="endedFun()"></video> auto-pause-if-navigate :enable-progress-gesture="false" :poster="videoCoverImg" @pause="videoPause" @ended="endedFun()"></video>
</view> </view>
<!-- #endif --> <!-- #endif -->
@ -48,7 +50,7 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | CRMEB [ CRMEB ] // | CRMEB [ CRMEB ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB // | Licensed CRMEBCRMEB
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
@ -72,10 +74,6 @@
}, },
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,
@ -99,25 +97,6 @@
// #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,
@ -130,7 +109,6 @@
this.autoplay = true this.autoplay = true
// #endif // #endif
}, },
bindPause: function() { bindPause: function() {
// #ifndef APP-PLUS // #ifndef APP-PLUS
this.videoContext.play(); this.videoContext.play();
@ -162,18 +140,15 @@
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: 750rpx; width: 100%;
height: 750rpx; height: 100%;
} }
.product-bg .pages { .product-bg .pages {
position: absolute; position: absolute;
background-color: #fff; background-color: #fff;
@ -186,18 +161,15 @@
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;
@ -206,12 +178,10 @@
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%;
@ -222,18 +192,8 @@
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

@ -1,7 +1,6 @@
<template> <template>
<view :style="viewColor"> <view :style="viewColor">
<view class="product-window" <view class="product-window" :class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'')">
:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-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.image ? attr.productSelect.image : image" @click="loookImg"></image> <image :src="attr.productSelect.image ? attr.productSelect.image : image" @click="loookImg"></image>
@ -14,8 +13,7 @@
<view> <view>
预售价 预售价
<text class="num">{{ attr.productSelect.price }}</text> <text class="num">{{ attr.productSelect.price }}</text>
<text v-if="presell_type === 2">定金<text <text v-if="presell_type === 2">定金¥<text class="num">{{ attr.productSelect.down_price }}</text></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>
@ -25,8 +23,7 @@
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<view v-if="type=='points'" class="points_money"> <view v-if="type=='points'" class="points_money">
<image :src="`${domain}/static/images/jf-point.png`" mode=""></image> <image :src="`${domain}/static/images/jf-point.png`" mode=""></image>
<text class="points-num">{{attr.productSelect.ot_price}}</text>积分 <text <text class="points-num">{{attr.productSelect.ot_price}}</text>积分 <text v-if="attr.productSelect.price > 0">+{{attr.productSelect.price}}</text>
v-if="attr.productSelect.price > 0">+{{attr.productSelect.price}}</text>
<text v-if="limitCount > 0" class="points-limit">限购{{limitCount}}</text> <text v-if="limitCount > 0" class="points-limit">限购{{limitCount}}</text>
</view> </view>
<view v-else> <view v-else>
@ -52,8 +49,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' : ''" <view class="itemn" :class="item.index === itemn.attr ? 'on' : ''" v-for="(itemn, indexn) in item.attr_value"
v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)" :key="indexn"> @click="tapAttr(indexw, indexn)" :key="indexn">
{{ itemn.attr }} {{ itemn.attr }}
</view> </view>
</view> </view>
@ -63,32 +60,25 @@
<view class="title">数量</view> <view class="title">数量</view>
<view class="carnum acea-row row-left"> <view class="carnum acea-row row-left">
<view class="buy_limit" v-if="minCount>0 || maxCount>0"> <view class="buy_limit" v-if="minCount>0 || maxCount>0">
(<text v-if="minCount>0">{{minCount}}件起购<text (<text v-if="minCount>0">{{minCount}}件起购<text v-if="minCount>0 && maxCount>0"></text></text><text v-if="maxCount>0">最多{{maxCount}}</text>)
v-if="minCount>0 && maxCount>0"></text></text><text
v-if="maxCount>0">最多{{maxCount}}</text>)
</view> </view>
<view class="item reduce" <view class="item reduce" :class="(attr.productSelect.cart_num <= 1 || (minCount>0 && attr.productSelect.cart_num<=minCount)) ? 'on' : ''" @click="CartNumDes">
:class="(attr.productSelect.cart_num <= 1 || (minCount>0 && attr.productSelect.cart_num<=minCount)) ? 'on' : ''"
@click="CartNumDes">
- -
</view> </view>
<view class='item num'> <view class='item num'>
<input type="number" v-model="attr.productSelect.cart_num" data-name="productSelect.cart_num" <input type="number" v-model="attr.productSelect.cart_num" data-name="productSelect.cart_num" @input="bindCode(attr.productSelect.cart_num)" @keydown.native="btKeyDown" @keyup.native="btKeyUp"></input>
@input="bindCode(attr.productSelect.cart_num)" @keydown.native="btKeyDown"
@keyup.native="btKeyUp"></input>
</view> </view>
<view v-if="iSplus" class="item plus" <view v-if="iSplus" class="item plus" :class="(attr.productSelect.cart_num >= attr.productSelect.stock || destri || (maxCount>0&&attr.productSelect.cart_num>=maxCount)) ? 'on' : ''"
:class="(attr.productSelect.cart_num >= attr.productSelect.stock || destri || (maxCount>0&&attr.productSelect.cart_num>=maxCount)) ? 'on' : ''"
@click="CartNumAdd">+</view> @click="CartNumAdd">+</view>
<view v-else class='item plus' <view v-else class='item plus' :class='((attr.productSelect.cart_num >= attr.productSelect.quota_show)
:class='((attr.productSelect.cart_num >= attr.productSelect.quota_show)
|| (attr.productSelect.cart_num >= attr.productSelect.product_stock) || (maxCount>0&&attr.productSelect.cart_num>=maxCount)) ? "on":""' || (attr.productSelect.cart_num >= attr.productSelect.product_stock) || (maxCount>0&&attr.productSelect.cart_num>=maxCount)) ? "on":""'
@click='CartNumAdd'>+</view> @click='CartNumAdd'>+</view>
</view> </view>
</view> </view>
<view class="joinBnt b-color" v-if="destri && attr.productSelect.stock>0" @click="goCat">立即购买</view> <view class="joinBnt b-color" v-if="destri && attr.productSelect.stock>0" @click="goCat">立即购买</view>
<view class="joinBnt on" v-else-if="destri && attr.productSelect.stock<=0">已售罄</view> <view class="joinBnt on" v-else-if="destri && attr.productSelect.stock<=0">已售罄</view>
<view class="joinBnt b-color" v-if="iSbnt && attr.productSelect.stock>0" @click="goCat">我要参团</view> <view class="joinBnt b-color" v-if="iSbnt && attr.productSelect.stock>0"
@click="goCat">我要参团</view>
<view class="joinBnt on" v-else-if="(iSbnt && attr.productSelect.stock<=0)">已售罄</view> <view class="joinBnt on" v-else-if="(iSbnt && attr.productSelect.stock<=0)">已售罄</view>
</view> </view>
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view> <view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
@ -105,9 +95,7 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { import { mapGetters } from "vuex";
mapGetters
} from "vuex";
export default { export default {
props: { props: {
attr: { attr: {
@ -177,7 +165,8 @@
}, },
computed: mapGetters(['viewColor']), computed: mapGetters(['viewColor']),
data() { data() {
return {}; return {
};
}, },
mounted(){ mounted(){
console.log(this.maxCount) console.log(this.maxCount)
@ -206,8 +195,7 @@
e.target.value = e.target.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,""); e.target.value = e.target.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,"");
}, },
btKeyUp(e) { btKeyUp(e) {
e.target.value = e.target.value.replace( e.target.value = e.target.value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g,"")
/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, "")
}, },
closeAttr: function() { closeAttr: function() {
this.$emit('myevent'); this.$emit('myevent');
@ -263,67 +251,55 @@
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;
padding-bottom: calc(200rpx+ constant(safe-area-inset-bottom)); /// IOS<11.2/ padding-bottom: calc(200rpx+ constant(safe-area-inset-bottom)); /// IOS<11.2/
padding-bottom: calc(200rpx + env(safe-area-inset-bottom)); /// IOS>11.2/ padding-bottom: calc(200rpx + env(safe-area-inset-bottom)); /// IOS>11.2/
} }
} }
.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: 26rpx; margin-top: 26rpx;
font-weight: 700; font-weight: 700;
color: var(--view-priceColor); color: var(--view-priceColor);
} }
.product-window .textpic .text .money .points_money { .product-window .textpic .text .money .points_money {
font-weight: normal; font-weight: normal;
display: flex; display: flex;
align-items: baseline; align-items: baseline;
} }
.product-window .textpic .text .money .points_money image{ .product-window .textpic .text .money .points_money image{
width: 26rpx; width: 26rpx;
height: 26rpx; height: 26rpx;
} }
.product-window .textpic .text .money .points_money .points-num{ .product-window .textpic .text .money .points_money .points-num{
font-size: 34rpx; font-size: 34rpx;
} }
.product-window .textpic .text .money .points_money .points-limit{ .product-window .textpic .text .money .points_money .points-limit{
display: flex; display: flex;
padding: 0 10rpx; padding: 0 10rpx;
@ -337,52 +313,42 @@
margin-left: 10rpx; margin-left: 10rpx;
font-size: 18rpx; font-size: 18rpx;
} }
.product-window .stock_count{ .product-window .stock_count{
margin-top: 5rpx; margin-top: 5rpx;
} }
.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;
font-weight: normal; font-weight: normal;
} }
.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;
} }
} }
.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 .iconfont { .product-window .textpic .iconfont {
position: absolute; position: absolute;
right: 30rpx; right: 30rpx;
@ -390,27 +356,22 @@
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;
@ -419,13 +380,11 @@
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;
@ -438,24 +397,20 @@
-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;
align-items: center; align-items: center;
} }
.product-window .cart .carnum .buy_limit { .product-window .cart .carnum .buy_limit {
font-size: 22rpx; font-size: 22rpx;
color: var(--view-theme); color: var(--view-theme);
margin-right: 30rpx; margin-right: 30rpx;
} }
.product-window .cart .carnum .item { .product-window .cart .carnum .item {
border: 1px solid #a4a4a4; border: 1px solid #a4a4a4;
width: 84rpx; width: 84rpx;
@ -465,34 +420,28 @@
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;
@ -502,12 +451,10 @@
line-height: 86rpx; line-height: 86rpx;
color: #fff; color: #fff;
margin: 21rpx auto 0 auto; margin: 21rpx 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

@ -63,7 +63,7 @@
</view> </view>
<!-- tab导航 --> <!-- tab导航 -->
<view class="tabs" v-if="showTab" :style="{top:'calc(98rpx + var(--status-bar-height))'}"> <view class="tabs" v-if="showTab">
<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)">
@ -74,11 +74,6 @@
</view> </view>
<view class='recommendList' :class="indexP?'on':''"> <view class='recommendList' :class="indexP?'on':''">
<view class="loadingicon acea-row row-center-wrapper"
v-if="!hostProduct || hostProduct.length == 0 || loading">
<text class="loading iconfont icon-jiazai loading-flex"></text>
{{ hotTitle }}
</view>
<WaterfallsFlow v-if="hostProduct.length>0" :wfList='hostProduct' @itemTap="goDetail" :type="0" <WaterfallsFlow v-if="hostProduct.length>0" :wfList='hostProduct' @itemTap="goDetail" :type="0"
:sale_type="sale_type" /> :sale_type="sale_type" />
<view class='pictrue' v-if="!loading&&hostProduct.length==0"> <view class='pictrue' v-if="!loading&&hostProduct.length==0">
@ -144,10 +139,6 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
hotTitle: {
type: String,
default: '加载更多'
}
}, },
data() { data() {
return { return {
@ -170,14 +161,12 @@
val: 4 val: 4
}], }],
currTabs: 1, currTabs: 1,
list: [], list: []
tabsTop: ''
}; };
}, },
mounted() { mounted() {
this.getArticleList(); this.getArticleList();
}, },
methods: { methods: {
changeTab(e) { changeTab(e) {
this.currTabs = e; this.currTabs = e;
@ -197,18 +186,6 @@
limit: 10 limit: 10
}).then(res => { }).then(res => {
this.list = res.data.list; this.list = res.data.list;
setTimeout(() => {
this.$util.getDom(this, '.tabs', res => {
// #ifdef APP
this.tabsTop = res.top + 10;
// #endif
// #ifdef H5
this.tabsTop = res.top;
// #endif
})
}, 300)
}) })
}, },
goDetail(item) { goDetail(item) {
@ -303,15 +280,10 @@
} }
.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;
margin: 0 -20rpx 10rpx; margin: 0 -20rpx 30rpx;
padding-top: 20rpx; padding-top: 20rpx;
.tabs-item { .tabs-item {
@ -351,7 +323,6 @@
.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 {
@ -363,6 +334,10 @@
} }
.information { .information {
// display: flex;
// justify-content: space-between;
// margin-bottom: 20rpx;
.nav-item { .nav-item {
width: 227rpx; width: 227rpx;
overflow: hidden; overflow: hidden;
@ -408,11 +383,6 @@
} }
} }
.loading-flex {
width: auto !important;
margin-right: 10rpx;
}
.pictrue { .pictrue {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -15,9 +15,9 @@ let openPlantGrass = '-openPlantGrass-'
let httpSix, httpApi; let httpSix, httpApi;
// const env = 'dev'; // 开发 const env = 'dev'; // 开发
// const env = 'prod'; // 生产 // const env = 'prod'; // 生产
const env = 'prew'; // 预上线 // const env = 'prew'; // 预上线
switch (env) { switch (env) {
case 'prod': case 'prod':

View File

@ -2,8 +2,8 @@
"name" : "惠农生活", "name" : "惠农生活",
"appid" : "__UNI__3A527D1", "appid" : "__UNI__3A527D1",
"description" : "", "description" : "",
"versionName": "2.0.53", "versionName" : "2.0.35",
"versionCode": 2053, "versionCode" : 2035,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
@ -126,8 +126,7 @@
"weixin" : { "weixin" : {
"appid" : "wx2e8f79ff281284f5", "appid" : "wx2e8f79ff281284f5",
"UniversalLinks" : "https://shop.lihaink.cn/" "UniversalLinks" : "https://shop.lihaink.cn/"
}, }
"univerify": {}
}, },
"ad" : {} "ad" : {}
}, },

View File

@ -19,39 +19,13 @@
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
// #endif // #endif
"app-plus": { "app-plus": {
"scrollIndicator": false, // "scrollIndicator": false //
"subNVues": [{
"id": "concatIndex", //
"path": "pages/index/subnvue/concat", //
"type": "popup",
"style": {
"position": "absolute",
"dock": "right",
"width": "750rpx",
"height": "1000px",
"background": "rgba(0,0,0,0.2)"
}
},
{
"id": "newUser", //
"path": "pages/index/subnvue/newUser", //
"type": "popup",
"style": {
"position": "absolute",
"dock": "right",
"width": "750rpx",
"height": "1000px",
"background": "rgba(0,0,0,0.2)"
}
}
]
} }
} }
}, { }, {
"path": "pages/whole_sale/index", "path": "pages/whole_sale/index",
"style": { "style": {
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationBarTitleText": "批发", "navigationBarTitleText": "批发",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
@ -60,22 +34,7 @@
"style": { "style": {
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"navigationBarTitleText": "工作台", "navigationBarTitleText": "工作台",
"navigationStyle": "custom", "navigationStyle": "custom"
"app-plus": {
"scrollIndicator": false, //
"subNVues": [{
"id": "concat", //
"path": "pages/gather/subnvue/concat", //
"type": "popup",
"style": {
"position": "absolute",
"dock": "right",
"width": "750rpx",
"height": "1500rpx",
"background": "rgba(0,0,0,0.2)"
}
}]
}
} }
}, { }, {
"path": "pages/order_addcart/order_addcart", "path": "pages/order_addcart/order_addcart",
@ -95,22 +54,7 @@
"style": { "style": {
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"navigationBarTitleText": "个人中心", "navigationBarTitleText": "个人中心",
"navigationStyle": "custom", "navigationStyle": "custom"
"app-plus": {
"scrollIndicator": false, //
"subNVues": [{
"id": "userSubnvu", //
"path": "pages/user/subnvue/index", //
"type": "popup",
"style": {
"position": "absolute",
"dock": "right",
"width": "750rpx",
"height": "1500rpx",
"background": "rgba(0,0,0,0.2)"
}
}]
}
} }
}, },
{ {
@ -161,13 +105,6 @@
// #endif // #endif
} }
}, },
{
"path": "pages/goods_details/videoPlay",
"style": {
"navigationBarTitleText": "视屏详情"
}
},
{ {
"path": "pages/goods_cate/goods_cate", "path": "pages/goods_cate/goods_cate",
"style": { "style": {
@ -388,7 +325,7 @@
"style": { "style": {
"navigationBarTitleText": "里海云仓", "navigationBarTitleText": "里海云仓",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": true
} }
}, },
{ {
@ -641,8 +578,7 @@
"path": "order_list/index", "path": "order_list/index",
"style": { "style": {
"navigationBarTitleText": "我的订单", "navigationBarTitleText": "我的订单",
"navigationStyle": "custom", "navigationStyle": "custom"
"enablePullDownRefresh": true
} }
}, },
{ {
@ -870,14 +806,7 @@
"path": "settled/index", "path": "settled/index",
"style": { "style": {
"navigationBarTitleText": "商家入驻", "navigationBarTitleText": "商家入驻",
"navigationStyle": "custom", "navigationStyle": "custom"
"enablePullDownRefresh": false
}
},
{
"path": "settled/index1",
"style": {
"navigationBarTitleText": "商家入驻"
} }
}, },
{ {
@ -1586,9 +1515,7 @@
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
//#ifndef H5 //#ifndef H5
, ,
"titleNView": true, "titleNView": true
"backgroundColorTop": "#40AE36",
"backgroundTextStyle": "light"
//#endif //#endif
//#ifdef H5 //#ifdef H5
, ,

View File

@ -4,12 +4,11 @@
<view class="store-wrapper" v-if="storeInfo"> <view class="store-wrapper" v-if="storeInfo">
<view class="left"> <view class="left">
<image :src="storeInfo.mer_avatar" mode=""></image> <image :src="storeInfo.mer_avatar" mode=""></image>
<view class="txt line1">{{storeInfo.mer_name}}</view> <view class="txt">{{storeInfo.mer_name}}</view>
</view> </view>
<view class="acea-row store-opeation"> <view class="acea-row store-opeation">
<navigator v-if="hide_mer_status != 1 && storeInfo.mer_id" <navigator v-if="hide_mer_status != 1 && storeInfo.mer_id"
:url="'/pages/store/home/index?id='+storeInfo.mer_id" class="link" open-type="redirect">进店 :url="'/pages/store/home/index?id='+storeInfo.mer_id" class="link" open-type="redirect">进店</navigator>
</navigator>
<text v-if="storeInfo.service_phone" class="iconfont icon-dadianhua01" @click="goCustomer"></text> <text v-if="storeInfo.service_phone" class="iconfont icon-dadianhua01" @click="goCustomer"></text>
</view> </view>
</view> </view>
@ -25,24 +24,20 @@
<!-- 左边 --> <!-- 左边 -->
<div class="item acea-row row-top" v-if="item.send_type == 0"> <div class="item acea-row row-top" v-if="item.send_type == 0">
<div v-if="item.msn_type !== 100" class="pictrue" @click="userDetail(item.user.uid)"> <div v-if="item.msn_type !== 100" class="pictrue" @click="userDetail(item.user.uid)">
<image :src="item.user.avatar ? item.user.avatar : '/static/images/f.png'" mode=""> <image :src="item.user.avatar ? item.user.avatar : '/static/images/f.png'" mode=""></image>
</image>
</div> </div>
<view v-if="item.msn_type === 100" class="recall-msg">对方撤回了一条消息</view> <view v-if="item.msn_type === 100" class="recall-msg">对方撤回了一条消息</view>
<div class="text"> <div class="text">
<div class="acea-row"> <div class="acea-row">
<!--退款订单链接--> <!--退款订单链接-->
<navigator <navigator v-if="item.msn_type === 6 && item.refundOrder && item.refundOrder.refund_order_id"
v-if="item.msn_type === 6 && item.refundOrder && item.refundOrder.refund_order_id" open-type="navigate" :url="'/pages/order_details/index?order_id='+item.refundOrder.order_id">
open-type="navigate"
:url="'/pages/order_details/index?order_id='+item.refundOrder.order_id">
<div class="broadcast-details_num"> <div class="broadcast-details_num">
<span>退款单号{{ item.refundOrder.refund_order_sn }}</span> <span>退款单号{{ item.refundOrder.refund_order_sn }}</span>
</div> </div>
<div class="conter acea-row row-middle"> <div class="conter acea-row row-middle">
<div class="broadcast-details_order noPad" <div class="broadcast-details_order noPad" v-for="(val, inx) in item.refundOrder.refundProduct"
v-for="(val, inx) in item.refundOrder.refundProduct"
:key="item.service_log_id"> :key="item.service_log_id">
<div class="broadcast-details_box noPad" v-if="inx == 0"> <div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img"> <div class="broadcast_details_img">
@ -52,9 +47,7 @@
</div> </div>
</div> </div>
<div class="broadcast_details_picBox noPad"> <div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit"> <div class="broadcast_details_tit">{{val.product.cart_info.product.store_name}}</div>
{{val.product.cart_info.product.store_name}}
</div>
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.refundOrder.refund_price }} {{ item.refundOrder.refund_price }}
</div> </div>
@ -68,19 +61,17 @@
<div class="broadcast-details_num acea-row row-middle"> <div class="broadcast-details_num acea-row row-middle">
<span>订单号{{ item.orderInfo.order_sn }}</span> <span>订单号{{ item.orderInfo.order_sn }}</span>
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<button class="copy copy-data" <button class="copy copy-data" :data-clipboard-text="item.orderInfo.order_sn">复制</button>
:data-clipboard-text="item.orderInfo.order_sn">复制</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
<button class="copy" <button class="copy" @tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
@tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
<!-- #endif --> <!-- #endif -->
</div> </div>
<navigator <navigator
:url="'/pages/admin/orderDetail/index?id='+item.orderInfo.order_id+'&mer_id='+item.orderInfo.mer_id" :url="'/pages/admin/orderDetail/index?id='+item.orderInfo.order_id+'&mer_id='+item.orderInfo.mer_id"
open-type="open-type" class="conter acea-row row-middle"> open-type="open-type" class="conter acea-row row-middle">
<div class="broadcast-details_order noPad" <div class="broadcast-details_order noPad" v-for="(val, inx) in item.orderInfo.orderProduct"
v-for="(val, inx) in item.orderInfo.orderProduct" :key="val.id"> :key="val.id">
<div class="broadcast-details_box noPad" v-if="inx == 0"> <div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img"> <div class="broadcast_details_img">
<image :src="val.cart_info.product.image" /> <image :src="val.cart_info.product.image" />
@ -89,9 +80,7 @@
</div> </div>
</div> </div>
<div class="broadcast_details_picBox noPad"> <div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit"> <div class="broadcast_details_tit">{{val.cart_info.product.store_name}}</div>
{{val.cart_info.product.store_name}}
</div>
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.orderInfo.pay_price }} {{ item.orderInfo.pay_price }}
</div> </div>
@ -101,13 +90,10 @@
</navigator> </navigator>
</div> </div>
<!--商品链接--> <!--商品链接-->
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle" v-if="item.msn_type === 4 && item.product">
v-if="item.msn_type === 4 && item.product">
<div class=" noPad"> <div class=" noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.product.product_id"
v-if="item.product.product_id" :url="`/pages/goods_details/index?id=${item.product.product_id}`" open-type="navigate">
:url="`/pages/goods_details/index?id=${item.product.product_id}`"
open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
<image :src="item.product.image" /> <image :src="item.product.image" />
</div> </div>
@ -115,9 +101,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.product.price }} {{ item.product.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.product.store_name}}</div>
{{item.product.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -126,8 +110,7 @@
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle"
v-if="item.msn_type === 7 && item.presell && item.presell.product"> v-if="item.msn_type === 7 && item.presell && item.presell.product">
<div class=" noPad"> <div class=" noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.presell.product_presell_id"
v-if="item.presell.product_presell_id"
:url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`" :url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`"
open-type="navigate"> open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
@ -137,9 +120,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.presell.price }} {{ item.presell.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.presell.store_name}}</div>
{{item.presell.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -148,8 +129,7 @@
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle"
v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product"> v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product">
<div class=" noPad"> <div class=" noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.productGroup.product_group_id"
v-if="item.productGroup.product_group_id"
:url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`" :url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`"
open-type="navigate"> open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
@ -159,9 +139,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.productGroup.product.price }} {{ item.productGroup.product.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.productGroup.product.store_name}}</div>
{{item.productGroup.product.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -170,8 +148,7 @@
<image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" /> <image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" />
</div> </div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 2"> <div class="conter acea-row row-middle" v-if="item.msn_type === 2">
<i class="em" :class="item.msn" <i class="em" :class="item.msn" :style="'background-image:url('+ httpUrl +')'"></i>
:style="'background-image:url('+ httpUrl +')'"></i>
</div> </div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 1"> <div class="conter acea-row row-middle" v-if="item.msn_type === 1">
{{item.msn}} {{item.msn}}
@ -181,14 +158,12 @@
</div> </div>
</div> </div>
<!-- 右边 --> <!-- 右边 -->
<div class="item acea-row row-top row-right" v-else <div class="item acea-row row-top row-right" v-else @longpress="longTime(items,index,item,j)">
@longpress="longTime(items,index,item,j)">
<div class="text textR"> <div class="text textR">
<!-- <div class="name">{{ item.user.nickname }}</div> --> <!-- <div class="name">{{ item.user.nickname }}</div> -->
<div class="acea-row "> <div class="acea-row ">
<!--退款订单链接--> <!--退款订单链接-->
<navigator v-if="item.msn_type === 6 && item.refundOrder.refund_order_id" <navigator v-if="item.msn_type === 6 && item.refundOrder.refund_order_id" open-type="navigate">
open-type="navigate">
<div class="broadcast-details_num acea-row row-middle"> <div class="broadcast-details_num acea-row row-middle">
<text>订单号{{ item.refundOrder.refund_order_sn }}</text> <text>订单号{{ item.refundOrder.refund_order_sn }}</text>
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
@ -196,13 +171,12 @@
:data-clipboard-text="item.refundOrder.refund_order_sn">复制</button> :data-clipboard-text="item.refundOrder.refund_order_sn">复制</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
<button class="copy" <button class="copy" @tap.stop="copyText(item.refundOrder.refund_order_sn)">复制</button>
@tap.stop="copyText(item.refundOrder.refund_order_sn)">复制</button>
<!-- #endif --> <!-- #endif -->
</div> </div>
<div class="conter acea-row row-middle"> <div class="conter acea-row row-middle">
<div class="broadcast-details_order noPad" <div class="broadcast-details_order noPad" v-for="(val, inx) in item.refundOrder.refundProduct"
v-for="(val, inx) in item.refundOrder.refundProduct" :key="val.id"> :key="val.id">
<div class="broadcast-details_box noPad" v-if="inx == 0"> <div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img"> <div class="broadcast_details_img">
<image :src="val.product.cart_info.product.image" /> <image :src="val.product.cart_info.product.image" />
@ -211,9 +185,7 @@
</div> </div>
</div> </div>
<div class="broadcast_details_picBox noPad"> <div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit"> <div class="broadcast_details_tit">{{val.product.cart_info.product.store_name}}</div>
{{val.product.cart_info.product.store_name}}
</div>
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.refundOrder.refund_price }} {{ item.refundOrder.refund_price }}
</div> </div>
@ -227,19 +199,17 @@
<div class="broadcast-details_num acea-row row-middle"> <div class="broadcast-details_num acea-row row-middle">
<text>订单号{{ item.orderInfo.order_sn }}</text> <text>订单号{{ item.orderInfo.order_sn }}</text>
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<button class="copy copy-data" <button class="copy copy-data" :data-clipboard-text="item.orderInfo.order_sn">复制</button>
:data-clipboard-text="item.orderInfo.order_sn">复制</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
<button class="copy" <button class="copy" @tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
@tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
<!-- #endif --> <!-- #endif -->
</div> </div>
<navigator <navigator
:url="'/pages/admin/orderDetail/index?id='+item.orderInfo.order_id+'&mer_id='+item.orderInfo.mer_id" :url="'/pages/admin/orderDetail/index?id='+item.orderInfo.order_id+'&mer_id='+item.orderInfo.mer_id"
open-type="navigate" class="conter acea-row row-middle"> open-type="navigate" class="conter acea-row row-middle">
<div class="broadcast-details_order noPad" <div class="broadcast-details_order noPad" v-for="(val, inx) in item.orderInfo.orderProduct"
v-for="(val, inx) in item.orderInfo.orderProduct" :key="val.id"> :key="val.id">
<div class="broadcast-details_box noPad" v-if="inx == 0"> <div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img"> <div class="broadcast_details_img">
<image :src="val.cart_info.product.image" /> <image :src="val.cart_info.product.image" />
@ -248,9 +218,7 @@
</div> </div>
</div> </div>
<div class="broadcast_details_picBox noPad"> <div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit"> <div class="broadcast_details_tit">{{val.cart_info.product.store_name}}</div>
{{val.cart_info.product.store_name}}
</div>
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.orderInfo.pay_price }} {{ item.orderInfo.pay_price }}
</div> </div>
@ -260,11 +228,9 @@
</navigator> </navigator>
</div> </div>
<!--商品链接--> <!--商品链接-->
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle" v-if="item.msn_type === 4 && item.product">
v-if="item.msn_type === 4 && item.product">
<div class=" acea-row row-column-around noPad"> <div class=" acea-row row-column-around noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.product.product_id"
v-if="item.product.product_id"
:url="`/pages/goods_details/index?id=${item.product.product_id}`"> :url="`/pages/goods_details/index?id=${item.product.product_id}`">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
<image :src="item.product.image" /> <image :src="item.product.image" />
@ -273,9 +239,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.product.price }} {{ item.product.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.product.store_name}}</div>
{{item.product.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -284,8 +248,7 @@
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle"
v-if="item.msn_type === 7 && item.presell && item.presell.product"> v-if="item.msn_type === 7 && item.presell && item.presell.product">
<div class=" acea-row row-column-around noPad"> <div class=" acea-row row-column-around noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.presell.product_presell_id"
v-if="item.presell.product_presell_id"
:url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`" :url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`"
open-type="navigate"> open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
@ -295,9 +258,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.presell.price }} {{ item.presell.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.presell.store_name}}</div>
{{item.presell.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -306,8 +267,7 @@
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle"
v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product"> v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product">
<div class=" acea-row row-column-around noPad"> <div class=" acea-row row-column-around noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.productGroup.product_group_id"
v-if="item.productGroup.product_group_id"
:url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`" :url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`"
open-type="navigate"> open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
@ -317,9 +277,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.productGroup.product.price }} {{ item.productGroup.product.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.productGroup.product.store_name}}</div>
{{item.productGroup.product.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -328,8 +286,7 @@
<image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" /> <image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" />
</div> </div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 2"> <div class="conter acea-row row-middle" v-if="item.msn_type === 2">
<i class="em" :class="item.msn" <i class="em" :class="item.msn" :style="'background-image:url('+ httpUrl +')'"></i>
:style="'background-image:url('+ httpUrl +')'"></i>
</div> </div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 1"> <div class="conter acea-row row-middle" v-if="item.msn_type === 1">
{{item.msn}} {{item.msn}}
@ -350,8 +307,8 @@
</view> </view>
<!-- #endif --> <!-- #endif -->
</view> </view>
<view v-if="(new Date().getTime()/1000 - item.send_time) <= 120" <view v-if="(new Date().getTime()/1000 - item.send_time) <= 120" class="recall-item"
class="recall-item" @click.stop="reverstMsg(item)"> @click.stop="reverstMsg(item)">
<view class="iconfont icon-chehui"></view>撤回 <view class="iconfont icon-chehui"></view>撤回
</view> </view>
</view> </view>
@ -371,24 +328,21 @@
<!-- 左边 --> <!-- 左边 -->
<div class="item acea-row row-top" v-if="item.send_type == 1"> <div class="item acea-row row-top" v-if="item.send_type == 1">
<div v-if="item.msn_type !== 100" class="pictrue"> <div v-if="item.msn_type !== 100" class="pictrue">
<image :src="item.service.avatar ? item.service.avatar : '/static/images/f.png'" <image :src="item.service.avatar ? item.service.avatar : '/static/images/f.png'" mode=""></image>
mode=""></image>
</div> </div>
<view v-if="item.msn_type === 100" class="recall-msg">对方撤回了一条消息</view> <view v-if="item.msn_type === 100" class="recall-msg">对方撤回了一条消息</view>
<div class="text"> <div class="text">
<!-- <div class="name">{{ item.service.nickname }}</div> --> <!-- <div class="name">{{ item.service.nickname }}</div> -->
<div class="acea-row"> <div class="acea-row">
<!--退款订单链接--> <!--退款订单链接-->
<navigator v-if="item.msn_type === 6 && item.refundOrder.refund_order_id" <navigator v-if="item.msn_type === 6 && item.refundOrder.refund_order_id" open-type="navigate"
open-type="navigate"
:url="'/pages/order_details/index?order_id='+item.refundOrder.order_id"> :url="'/pages/order_details/index?order_id='+item.refundOrder.order_id">
<div class="broadcast-details_num"> <div class="broadcast-details_num">
<text>退款单号{{ item.refundOrder.refund_order_sn }}</text> <text>退款单号{{ item.refundOrder.refund_order_sn }}</text>
</div> </div>
<div class="conter acea-row row-middle"> <div class="conter acea-row row-middle">
<!-- :key="item.service_log_id" --> <!-- :key="item.service_log_id" -->
<div class="broadcast-details_order noPad" <div class="broadcast-details_order noPad" v-for="(val, inx) in item.refundOrder.refundProduct">
v-for="(val, inx) in item.refundOrder.refundProduct">
<div class="broadcast-details_box noPad" v-if="inx == 0"> <div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img"> <div class="broadcast_details_img">
<image :src="val.product.cart_info.product.image" /> <image :src="val.product.cart_info.product.image" />
@ -397,9 +351,7 @@
</div> </div>
</div> </div>
<div class="broadcast_details_picBox noPad"> <div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit"> <div class="broadcast_details_tit">{{val.product.cart_info.product.store_name}}</div>
{{val.product.cart_info.product.store_name}}
</div>
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ val.product.cart_info.productAttr.price }} {{ val.product.cart_info.productAttr.price }}
</div> </div>
@ -413,20 +365,16 @@
<div class="broadcast-details_num acea-row row-middle"> <div class="broadcast-details_num acea-row row-middle">
<text>订单号{{ item.orderInfo.order_sn }}</text> <text>订单号{{ item.orderInfo.order_sn }}</text>
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<button class="copy copy-data" <button class="copy copy-data" :data-clipboard-text="item.orderInfo.order_sn">复制</button>
:data-clipboard-text="item.orderInfo.order_sn">复制</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
<button class="copy" <button class="copy" @tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
@tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
<!-- #endif --> <!-- #endif -->
</div> </div>
<navigator <navigator :url="'/pages/order_details/index?order_id='+item.orderInfo.order_id"
:url="'/pages/order_details/index?order_id='+item.orderInfo.order_id"
open-type="navigate" class="conter acea-row row-middle"> open-type="navigate" class="conter acea-row row-middle">
<!-- :key="item.service_log_id" --> <!-- :key="item.service_log_id" -->
<div class="broadcast-details_order noPad" <div class="broadcast-details_order noPad" v-for="(val, inx) in item.orderInfo.orderProduct">
v-for="(val, inx) in item.orderInfo.orderProduct">
<div class="broadcast-details_box noPad" v-if="inx == 0"> <div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img"> <div class="broadcast_details_img">
<image :src="val.cart_info.product.image" /> <image :src="val.cart_info.product.image" />
@ -435,9 +383,7 @@
</div> </div>
</div> </div>
<div class="broadcast_details_picBox noPad"> <div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit"> <div class="broadcast_details_tit">{{val.cart_info.product.store_name}}</div>
{{val.cart_info.product.store_name}}
</div>
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.orderInfo.pay_price }} {{ item.orderInfo.pay_price }}
</div> </div>
@ -447,13 +393,10 @@
</navigator> </navigator>
</div> </div>
<!--商品链接--> <!--商品链接-->
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle" v-if="item.msn_type === 4 && item.product">
v-if="item.msn_type === 4 && item.product">
<div class=" noPad"> <div class=" noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.product.product_id"
v-if="item.product.product_id" :url="`/pages/goods_details/index?id=${item.product.product_id}`" open-type="navigate">
:url="`/pages/goods_details/index?id=${item.product.product_id}`"
open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
<image :src="item.product.image" /> <image :src="item.product.image" />
</div> </div>
@ -461,9 +404,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.product.price }} {{ item.product.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.product.store_name}}</div>
{{item.product.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -472,8 +413,7 @@
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle"
v-if="item.msn_type === 7 && item.presell && item.presell.product"> v-if="item.msn_type === 7 && item.presell && item.presell.product">
<div class=" noPad"> <div class=" noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.presell.product_presell_id"
v-if="item.presell.product_presell_id"
:url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`" :url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`"
open-type="navigate"> open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
@ -483,9 +423,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.presell.price }} {{ item.presell.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.presell.store_name}}</div>
{{item.presell.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -494,8 +432,7 @@
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle"
v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product"> v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product">
<div class="noPad"> <div class="noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.productGroup.product_group_id"
v-if="item.productGroup.product_group_id"
:url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`" :url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`"
open-type="navigate"> open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
@ -505,9 +442,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.productGroup.product.price }} {{ item.productGroup.product.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.productGroup.product.store_name}}</div>
{{item.productGroup.product.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -516,8 +451,7 @@
<image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" /> <image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" />
</div> </div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 2"> <div class="conter acea-row row-middle" v-if="item.msn_type === 2">
<i class="em" :class="item.msn" <i class="em" :class="item.msn" :style="'background-image:url('+ httpUrl +')'"></i>
:style="'background-image:url('+ httpUrl +')'"></i>
</div> </div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 1"> <div class="conter acea-row row-middle" v-if="item.msn_type === 1">
{{item.msn}} {{item.msn}}
@ -532,16 +466,14 @@
<!-- <div class="name">{{ item.user.nickname }}</div> --> <!-- <div class="name">{{ item.user.nickname }}</div> -->
<div class="acea-row" @longpress="longTime(items,index,item,j)"> <div class="acea-row" @longpress="longTime(items,index,item,j)">
<!--退款订单链接--> <!--退款订单链接-->
<navigator v-if="item.msn_type === 6 && item.refundOrder.refund_order_id" <navigator v-if="item.msn_type === 6 && item.refundOrder.refund_order_id" open-type="navigate"
open-type="navigate"
:url="'/pages/order_details/index?order_id='+item.refundOrder.order_id"> :url="'/pages/order_details/index?order_id='+item.refundOrder.order_id">
<div class="broadcast-details_num"> <div class="broadcast-details_num">
<text>退款单号{{ item.refundOrder.refund_order_sn }}</text> <text>退款单号{{ item.refundOrder.refund_order_sn }}</text>
</div> </div>
<div class="conter acea-row row-middle"> <div class="conter acea-row row-middle">
<!-- :key="item.service_log_id" --> <!-- :key="item.service_log_id" -->
<div class="broadcast-details_order noPad" <div class="broadcast-details_order noPad" v-for="(val, inx) in item.refundOrder.refundProduct">
v-for="(val, inx) in item.refundOrder.refundProduct">
<div class="broadcast-details_box noPad" v-if="inx == 0"> <div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img"> <div class="broadcast_details_img">
<image :src="val.product.cart_info.product.image" /> <image :src="val.product.cart_info.product.image" />
@ -550,9 +482,7 @@
</div> </div>
</div> </div>
<div class="broadcast_details_picBox noPad"> <div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit"> <div class="broadcast_details_tit">{{val.product.cart_info.product.store_name}}</div>
{{val.product.cart_info.product.store_name}}
</div>
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{item.refundOrder.refund_num}}件商品 {{item.refundOrder.refund_num}}件商品
合计 {{ item.refundOrder.refund_price }} 合计 {{ item.refundOrder.refund_price }}
@ -567,19 +497,15 @@
<div class="broadcast-details_num acea-row row-middle"> <div class="broadcast-details_num acea-row row-middle">
<text>订单号{{ item.orderInfo.order_sn }}</text> <text>订单号{{ item.orderInfo.order_sn }}</text>
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<button class="copy copy-data" <button class="copy copy-data" :data-clipboard-text="item.orderInfo.order_sn">复制</button>
:data-clipboard-text="item.orderInfo.order_sn">复制</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
<button class="copy" <button class="copy" @tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
@tap.stop="copyText(item.orderInfo.order_sn)">复制</button>
<!-- #endif --> <!-- #endif -->
</div> </div>
<navigator <navigator :url="'/pages/order_details/index?order_id='+item.orderInfo.order_id"
:url="'/pages/order_details/index?order_id='+item.orderInfo.order_id"
open-type="navigate" class="conter acea-row row-middle"> open-type="navigate" class="conter acea-row row-middle">
<div class="broadcast-details_order noPad" <div class="broadcast-details_order noPad" v-for="(val, inx) in item.orderInfo.orderProduct">
v-for="(val, inx) in item.orderInfo.orderProduct">
<div class="broadcast-details_box noPad" v-if="inx == 0"> <div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img"> <div class="broadcast_details_img">
<image :src="val.cart_info.product.image" /> <image :src="val.cart_info.product.image" />
@ -588,9 +514,7 @@
</div> </div>
</div> </div>
<div class="broadcast_details_picBox noPad"> <div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit"> <div class="broadcast_details_tit">{{val.cart_info.product.store_name}}</div>
{{val.cart_info.product.store_name}}
</div>
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.orderInfo.pay_price }} {{ item.orderInfo.pay_price }}
</div> </div>
@ -600,13 +524,10 @@
</navigator> </navigator>
</div> </div>
<!--商品链接--> <!--商品链接-->
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle" v-if="item.msn_type === 4 && item.product">
v-if="item.msn_type === 4 && item.product">
<div class="acea-row row-column-around noPad"> <div class="acea-row row-column-around noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.product.product_id"
v-if="item.product.product_id" :url="`/pages/goods_details/index?id=${item.product.product_id}`" open-type="navigate">
:url="`/pages/goods_details/index?id=${item.product.product_id}`"
open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
<image :src="item.product.image" /> <image :src="item.product.image" />
</div> </div>
@ -614,9 +535,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.product.price }} {{ item.product.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.product.store_name}}</div>
{{item.product.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -625,8 +544,7 @@
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle"
v-if="item.msn_type === 7 && item.presell && item.presell.product"> v-if="item.msn_type === 7 && item.presell && item.presell.product">
<div class="acea-row row-column-around noPad"> <div class="acea-row row-column-around noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.presell.product_presell_id"
v-if="item.presell.product_presell_id"
:url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`" :url="`/pages/activity/presell_details/index?id=${item.presell.product_presell_id}`"
open-type="navigate"> open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
@ -636,9 +554,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.presell.price }} {{ item.presell.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.presell.store_name}}</div>
{{item.presell.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -647,8 +563,7 @@
<div class="conter acea-row row-middle" <div class="conter acea-row row-middle"
v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product"> v-if="item.msn_type === 8 && item.productGroup && item.productGroup.product">
<div class="acea-row row-column-around noPad"> <div class="acea-row row-column-around noPad">
<navigator class="acea-row row-column-around noPad" <navigator class="acea-row row-column-around noPad" v-if="item.productGroup.product_group_id"
v-if="item.productGroup.product_group_id"
:url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`" :url="`/pages/activity/combination_details/index?id=${item.productGroup.product_group_id}`"
open-type="navigate"> open-type="navigate">
<div class="broadcast_details_img_no"> <div class="broadcast_details_img_no">
@ -658,9 +573,7 @@
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.productGroup.product.price }} {{ item.productGroup.product.price }}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">{{item.productGroup.product.store_name}}</div>
{{item.productGroup.product.store_name}}
</div>
</div> </div>
</navigator> </navigator>
</div> </div>
@ -669,8 +582,7 @@
<image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" /> <image :src="item.msn" @click="clickImg(item.msn)" mode="heightFix" />
</div> </div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 2"> <div class="conter acea-row row-middle" v-if="item.msn_type === 2">
<i class="em" :class="item.msn" <i class="em" :class="item.msn" :style="'background-image:url('+ httpUrl +')'"></i>
:style="'background-image:url('+ httpUrl +')'"></i>
</div> </div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 1"> <div class="conter acea-row row-middle" v-if="item.msn_type === 1">
{{ item.msn }} {{ item.msn }}
@ -691,8 +603,8 @@
</view> </view>
<!-- #endif --> <!-- #endif -->
</view> </view>
<view v-if="(new Date().getTime()/1000 - item.send_time) <= 120" <view v-if="(new Date().getTime()/1000 - item.send_time) <= 120" class="recall-item"
class="recall-item" @click.stop="reverstMsg(item)"> @click.stop="reverstMsg(item)">
<view class="iconfont icon-chehui"></view>撤回 <view class="iconfont icon-chehui"></view>撤回
</view> </view>
</view> </view>
@ -741,8 +653,7 @@
</div> </div>
<div> <div>
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ orderInfo.total_num }}件商品合计 <text {{ orderInfo.total_num }}件商品合计 <text class="p-color">{{ orderInfo.pay_price }}</text>
class="p-color">{{ orderInfo.pay_price }}</text>
</div> </div>
<div class="broadcast_details_btn" @click="sendOrder"> <div class="broadcast_details_btn" @click="sendOrder">
发送订单 发送订单
@ -794,8 +705,7 @@
</div> </div>
<view class="input_count"> <view class="input_count">
<input type="text" placeholder-class='placeholder' placeholder="输入内容" class="input" ref="input" <input type="text" placeholder-class='placeholder' placeholder="输入内容" class="input" ref="input"
v-show="!voice" @input="bindInput" @keyup="keyup" @focus="focus" cursor-spacing="20" v-show="!voice" @input="bindInput" @keyup="keyup" @focus="focus" cursor-spacing="20" v-model="textCon">
v-model="textCon">
<div class="send iconfont icon-fasong" :style="'color:'+iconColor" @click="sendTest"></div> <div class="send iconfont icon-fasong" :style="'color:'+iconColor" @click="sendTest"></div>
</view> </view>
</div> </div>
@ -805,8 +715,8 @@
:duration="duration" v-if="emojiGroup.length > 0"> :duration="duration" v-if="emojiGroup.length > 0">
<block v-for="(emojiList, index) in emojiGroup" :key="index"> <block v-for="(emojiList, index) in emojiGroup" :key="index">
<swiper-item> <swiper-item>
<i class="em" :class="emoji" :style="'background-image:url('+ httpUrl +')'" <i class="em" :class="emoji" :style="'background-image:url('+ httpUrl +')'" v-for="emoji in emojiList"
v-for="emoji in emojiList" :key="emoji" @click="addEmoji(emoji)"></i> :key="emoji" @click="addEmoji(emoji)"></i>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
@ -832,39 +742,15 @@
// #ifdef H5 // #ifdef H5
import ClipboardJS from "@/plugin/clipboard/clipboard.js"; import ClipboardJS from "@/plugin/clipboard/clipboard.js";
// #endif // #endif
import { import { getChatRecord, getMerHistory, chatReverstApi, hasServiceApi } from "@/api/user";
getChatRecord, import { getProductDetail, getPresellProductDetail, getStoreDetail } from "@/api/store";
getMerHistory, import { getCombinationDetail } from "@/api/activity";
chatReverstApi, import { getOrderDetail, refundDetail } from "@/api/order";
hasServiceApi
} from "@/api/user";
import {
getProductDetail,
getPresellProductDetail,
getStoreDetail,
consultApi
} from "@/api/store";
import {
getCombinationDetail
} from "@/api/activity";
import {
getOrderDetail,
refundDetail
} from "@/api/order";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { import { TOKENNAME, HTTP_REQUEST_URL } from '@/config/app.js';
TOKENNAME, import { toLogin } from '@/libs/login.js';
HTTP_REQUEST_URL import { configMap } from "@/utils";
} from '@/config/app.js'; import { mapGetters } from "vuex";
import {
toLogin
} from '@/libs/login.js';
import {
configMap
} from "@/utils";
import {
mapGetters
} from "vuex";
const chunk = function(arr, num) { const chunk = function(arr, num) {
num = num * 1 || 1; num = num * 1 || 1;
var ret = []; var ret = [];
@ -1044,23 +930,16 @@
}); });
uni.$on(["reply", "chat", "send_chat"], data => { uni.$on(["reply", "chat", "send_chat"], data => {
data.longpress = false data.longpress = false
if (that.history.length > 0 && that.history[that.history.length - 1]['children'].length > if (that.history.length > 0 && that.history[that.history.length - 1]['children'].length > 0) {
0) {
let index = that.history[that.history.length - 1]['children'].length - 1 let index = that.history[that.history.length - 1]['children'].length - 1
let item = that.history[that.history.length - 1]['children'][index] let item = that.history[that.history.length - 1]['children'][index]
if (data.send_time - item.send_time > 300) { if (data.send_time - item.send_time > 300) {
that.history.push({ that.history.push({ time: data.create_time, children: [data] })
time: data.create_time,
children: [data]
})
} else { } else {
that.history[that.history.length - 1]['children'].push(data); that.history[that.history.length - 1]['children'].push(data);
} }
} else { } else {
that.history.push({ that.history.push({ time: data.create_time, children: [data] })
time: data.create_time,
children: [data]
})
} }
that.deleteMsg(data); that.deleteMsg(data);
that.height(); that.height();
@ -1291,9 +1170,7 @@
getChatRecord(this.mer_id, { getChatRecord(this.mer_id, {
page: this.page, page: this.page,
limit: this.limit limit: this.limit
}).then(({ }).then(({ data }) => {
data
}) => {
let arr = this.getChatTime(data.list) let arr = this.getChatTime(data.list)
let newArr = [] let newArr = []
for (var j in arr) { for (var j in arr) {
@ -1450,10 +1327,6 @@
this.height(); this.height();
}, },
sendProduct() { sendProduct() {
consultApi({
user_id: this.toUid,
product_id: this.productId
})
if (this.presellId || this.combinationId) { if (this.presellId || this.combinationId) {
if (this.presellId) { if (this.presellId) {
this.sendMsg(this.presellId, 7); this.sendMsg(this.presellId, 7);
@ -1566,9 +1439,7 @@
}, },
//#ifndef H5 //#ifndef H5
copyText: function(text) { copyText: function(text) {
uni.setClipboardData({ uni.setClipboardData({ data: text });
data: text
});
}, },
// #endif // #endif
} }
@ -2140,10 +2011,6 @@
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.txt {
max-width: 480rpx;
}
} }
.link { .link {

View File

@ -12,11 +12,10 @@
<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" <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 == 5 || item.last.msn_type == 6)">[订单]</view>
</view> </view>
<view class="right-box"> <view class="right-box">
<view class="time">{{item.display_time}}</view> <view class="time">{{item.last && item.last.create_time.split(' ')[1] || ''}}</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>
@ -24,21 +23,18 @@
<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'" <image :src="(item.user && item.user.avatar) ? item.user.avatar : '/static/images/f.png'" mode=""></image>
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" <view class="con line1" v-if="item.last && (item.last.msn_type == 4 || item.last.msn_type == 7)">[商品]</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 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.display_time}}</view> <view class="time">{{item.last && item.last.create_time.split(' ')[1]}}</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>
@ -61,16 +57,9 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import emptyPage from '@/components/emptyPage.vue' import emptyPage from '@/components/emptyPage.vue'
import { import { serviceList, serviceUserList } from "@/api/user";
serviceList, import { toLogin } from '@/libs/login.js';
serviceUserList import { mapGetters } from "vuex";
} from "@/api/user";
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
export default { export default {
name: "CustomerList", name: "CustomerList",
components:{ components:{
@ -218,7 +207,6 @@
transform: rotate(180deg); transform: rotate(180deg);
font-size: 36rpx; font-size: 36rpx;
} }
.popupn{ .popupn{
position: fixed; position: fixed;
width: 100%; width: 100%;
@ -229,20 +217,17 @@
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;
@ -250,44 +235,36 @@
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;
@ -295,11 +272,9 @@
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);

View File

@ -7,32 +7,57 @@
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;
} }
.wholeSale-section { .scrollview-active {
position: sticky; position: relative;
top: calc(82rpx + var(--status-bar-height)); font-weight: bold;
padding: 0rpx 20rpx; font-size: 36rpx;
background-color: #fff; color: #FFFFFF;
transition: height .5s;
overflow: hidden; &::after {
margin-bottom: 20rpx; 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 { .wholeSale-nav {
display: flex; display: flex;
align-items: center; align-items: center;
padding-bottom: 20rpx; margin-bottom: 40rpx;
.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;
@ -66,18 +91,15 @@
color: #fff; 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: 10rpx; padding-bottom: 20rpx;
.category-item { .category-item {
display: flex; display: flex;
@ -118,24 +140,6 @@
} }
} }
} }
.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 {
@ -165,83 +169,42 @@
} }
} }
} }
}
.popup-wrap { .comprehensive {
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; display: flex;
flex-wrap: wrap; justify-content: space-between;
.popup-wrap-category-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center; align-items: center;
margin: 0 20rpx 20rpx 0; padding: 0 50rpx;
&:nth-child(5n) { [class^=comprehensive-] {
margin-right: 0; display: flex;
} align-items: center;
text { text {
margin-top: 16rpx; margin-right: 12rpx;
font-size: 24rpx; font-size: 26rpx;
color: #666666; color: #666666;
white-space: nowrap;
} }
.popup-wrap-category-item-text { image {
width: 120rpx; width: 28rpx;
text-align: center; height: 28rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
.popup-wrap-category-item-active { .loudou {
position: relative; width: 24rpx;
height: 24rpx;
.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 {
height: 100vh;
margin: 0 20rpx;
padding-bottom: 30rpx;
}
}
</style> </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;">
@ -250,9 +213,11 @@
</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}`)" <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">
@ -260,6 +225,7 @@
<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>
@ -281,11 +247,6 @@
</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>
<!-- 商品小分类 --> <!-- 商品小分类 -->
@ -301,45 +262,26 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view>
<!-- 内容 --> <!-- 综合查询 -->
<view class="wholeSale-con" <!-- <view class="comprehensive">
:style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx '+(isShowSmall?' - 48rpx':'')+')'}"> <view class="comprehensive-price">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;" <text>价格</text>
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling" <image src="@/static/new_define/priceChange.png"></image>
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'> </view>
<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" /> <WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore> <loadmore :type="isLoading"></loadmore>
</view> </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>
@ -368,68 +310,27 @@
page: 1, page: 1,
limit: 20, limit: 20,
mer_type: 1, //1-, 2-, 3- mer_type: 1, //1-, 2-, 3-
cate_pid: '', mer_cate_id: '',
keyword: '', keyword: '',
deduction_rate: '', // deduction_rate: '', //
rand: 1 rand: 1
}, }
wrapHeight: 300,
isShowSmall: false,
scrollTop: 0,
isTriggered: true
} }
}, },
onLoad(option) { onLoad(option) {
this.getStoreCategory(); this.getStoreCategory();
this.getProductslist(true); this.getProductslist(true);
}, },
onReachBottom() {
onPageScroll(e) {
uni.$emit('scroll');
},
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: {
//
onPulling() {
if (!this.isTriggered) {
this.isTriggered = true;
this.getProductslist(true);
}
},
onRefresh(e) {
this.isTriggered = true;
},
onScrollBottom(e) {
this.getProductslist(); this.getProductslist();
}, },
onPageScroll() {
onAllCategory() { uni.$emit('scroll');
this.$refs.popup.open();
}, },
onPullDownRefresh() {
onScroll(e) { this.getProductslist(true);
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;
}, },
methods: {
navTo(url) { navTo(url) {
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
@ -443,11 +344,12 @@
} }
}) })
}, },
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 = [];
@ -457,16 +359,13 @@
store_category_id: '' store_category_id: ''
}) })
this.cate_change_children = 0; this.cate_change_children = 0;
this.where.cate_pid = this.store_category[e].store_category_id; this.where.mer_cate_id = 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.cate_pid = this.store_category_children[e].store_category_id; this.where.mer_cate_id = this.store_category_children[e].store_category_id;
if (e == 0) this.where.cate_pid = this.store_category[this.cate_change] if (e == 0) this.where.mer_cate_id = this.store_category[this.cate_change]
.store_category_id; // , id .store_category_id; // , id
this.getProductslist(true); this.getProductslist(true);
}, },
@ -492,17 +391,16 @@
} }
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
this.isTriggered = false; uni.stopPullDownRefresh();
this.hostProduct = [...this.hostProduct, ...res.data.list]; this.hostProduct = [...this.hostProduct, ...res.data.list];
this.isLoading = 0; this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1; if (res.data.list.length < this.where.limit) this.isLoading = -1;
this.where.page++; this.where.page++;
}).catch(err => { }).catch(err => {
this.isTriggered = false; uni.stopPullDownRefresh();
}) })
}, },
goDetail(item) { goDetail(item) {

View File

@ -1,441 +1,50 @@
<template>
<view class="wholeSale">
<!-- 适配不同机 -->
<view class="wholeSale-header">
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
<view
style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;justify-content: space-between;">
<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;position: relative;" @click="changeMap">
<view
style="width: 250rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;text-align: right;">
{{street}}
</view>
<u-icon name="arrow-down" size="14" color="#fff"></u-icon>
<view class="position-address" v-if="isShowAddress" @click.stop="">
<u-icon class="icon" name="close" size="14" @click="closeShowAddress" color="#fff"></u-icon>
<view class="title">
<view>开启定位服务</view>
<view>查看附近商铺</view>
</view>
<view class="btn" @click.stop="getLocation">立即开启</view>
</view>
</view>
</view>
</view>
<!-- 分类区域 -->
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-nav">
<view
@click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}&shop=true`)"
hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索店铺名称" :value="where.keyword"
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
</view>
</view>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.background"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.category_name}}</text>
</view>
</block>
</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>
<!-- 列表 -->
<view class="goods_list" :style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx)'}">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
<view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar">
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
</view>
<view class="content">
<view class="content-head">
<view class="title">{{item.mer_name}}</view>
<text style="font-size: 21.03rpx;color: #aaa;"
v-if="item.sales>=100">月销{{item.sales}}</text>
</view>
<view class="content-two">
<view class="score">
<view class="star">
<view
:style="{width: `${(item.service_score / 5 * 100).toFixed(0)}%`, backgroundImage: `url(${domain}/static/diy/score1${keyColor}.png)`}">
</view>
</view>
</view>
<text
style="margin-left: 20rpx;color: #FF6D20;font-size: 22.78rpx; ">{{item.service_score}}</text>
<text v-if="item.distance"
style="margin-left: 20rpx;font-size: 21.03rpx;color: #aaa;">{{item.distance}}</text>
<text style="margin-left:20rpx;" class="line1">{{item.category_name}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text> {{item.service_phone}}</text>
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true"
src="/static/images/GXSC/SJ.png" width="33.85rpx" height="33.85rpx"></u--image>
<text v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text class="address">{{item.mer_address}}</text>
</view>
</view>
</view>
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
</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.background"
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.category_name}}</text>
</view>
</block>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {
goShopDetail
} from '@/libs/order.js'
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
import {
getGeocoder
} from "@/api/store.js"
import {
merClassifly,
storeMerchantList
} from "@/api/store.js"
import {
configMap
} from '@/utils';
import {
mapGetters
} from "vuex";
import {
HTTP_REQUEST_URL
} from '@/config/app';
import {
Toast
} from '../../../libs/uniApi';
export default {
components: {
WaterfallsFlow
},
data() {
return {
domain: HTTP_REQUEST_URL,
hostProduct: [],
store_category: [], //
cate_change: 0,
goodsList: [],
isLoading: 0,
isShowAddress: false,
street: '定位中',
where: {
page: 1,
limit: 20,
keyword: '',
order: 'location',
type_id: '10,12,21,24',
merchant_category_id: '',
location: ''
},
wrapHeight: 300,
scrollTop: 0,
isTriggered: false
}
},
computed: {
...configMap({
margin_ico_switch: 0,
margin_ico: '',
mer_location: 0,
store_street_theme: 1,
hide_mer_status: '',
}, mapGetters(['viewColor', 'keyColor'])),
},
onLoad(option) {
let getAddress = uni.getStorageSync('getAddress');
let closeShow = uni.getStorageSync('closeShow');
if (!getAddress && !closeShow) this.isShowAddress = true;
this.street = this.$store.state.storage.address.townName;
if (this.$store.state.storage.location.lat) {
this.where.location =
`${this.$store.state.storage.location.lat},${this.$store.state.storage.location.long}`;
} else if (getAddress) {
this.street = '';
this.getLocation();
} else Toast('点击右上角开启定位后才可获取附近商家')
this.merClassifly();
this.storeMerchantList();
},
onPageScroll() {
uni.$emit('scroll');
},
methods: {
//
onPulling() {
if (!this.isTriggered) {
this.isTriggered = true;
this.storeMerchantList(true);
}
},
onRefresh(e) {
this.isTriggered = true;
},
onScrollBottom(e) {
this.storeMerchantList();
},
onAllCategory() {
this.$refs.popup.open();
},
onScroll(e) {
if (this.scrollTop > e.target.scrollTop) { //
this.wrapHeight = 300;
} else {
this.wrapHeight = 0;
}
this.scrollTop = e.target.scrollTop;
},
navTo(url) {
uni.navigateTo({
url: url,
success: () => {
uni.$once('searchValue', (e) => {
this.$nextTick(() => {
this.where.keyword = e;
this.storeMerchantList(true);
})
})
}
})
},
navBack() {
uni.navigateBack();
},
changeCate(e) {
this.cate_change = e;
this.where.merchant_category_id = this.store_category[e].merchant_category_id;
this.storeMerchantList(true);
this.$refs.popup && this.$refs.popup.close();
this.$forceUpdate();
},
//
goStore(id) {
uni.navigateTo({
url: `/pages/store/home/index?id=${id}`
})
},
merClassifly() {
merClassifly().then(res => {
this.store_category = [{
category_name: '全部',
merchant_category_id: '',
background: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0bc7a202404021652194310.png'
}, ...res.data];
})
},
storeMerchantList(reLoad = false) {
if (reLoad) {
this.where.page = 1;
this.goodsList = [];
this.isLoading = 0;
}
if (this.isLoading == -1) return;
this.isLoading = 1;
storeMerchantList(this.where).then(res => {
this.isTriggered = false;
this.goodsList = [...this.goodsList, ...res.data.list];
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
this.where.page++;
}).catch(() => {
this.isTriggered = false;
})
},
closeShowAddress() {
this.isShowAddress = false;
uni.setStorageSync('closeShow', true);
},
//
changeMap() {
uni.navigateTo({
url: `/pages/select_address_n/select_address_n`,
success: () => {
uni.$once('changeAddress', (e) => {
this.isShowAddress = false;
uni.setStorageSync('closeShow', true);
this.street = e.street.name;
this.$store.commit('setAddress', {
street_id: e.street.code,
townName: e.street.name
});
if (e.longitude) {
let latitude = e.latitude;
let longitude = e.longitude;
this.where.location = `${latitude},${longitude}`;
this.$store.commit('setLocation', {
lat: e.latitude,
long: e.longitude,
});
this.$nextTick(() => {
setTimeout(() => {
this.storeMerchantList(true);
}, 200)
})
}
})
}
})
},
getLocation() {
uni.getLocation({
type: 'gcj02',
success: (res) => {
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
this.$store.commit('setLocation', {
lat: res.latitude.toFixed(6),
long: res.longitude.toFixed(6),
});
this.isShowAddress = false;
uni.setStorageSync('closeShow', true);
uni.setStorageSync('getAddress', true);
getGeocoder({
lat: latitude,
long: longitude
}).then(res => {
let town = res.data.address_reference.town.title
let street_id = res.data.address_reference.town.id
this.street = res.data.address_reference.town.title;
this.$store.commit('setAddress', {
street_id: street_id,
townName: town
});
uni.$emit('getLocation_succees', {
street_id,
});
uni.$emit('changeAddress', {
addr: {
address: res.data.address,
location: `${res.data.location.lat},${res.data.location.lng}`
},
area: res.data.ad_info.adcode,
latitude: res.data.location.lat,
longitude: res.data.location.lng,
street: {
code: street_id,
name: town
}
})
this.where.location = `${latitude},${longitude}`;
this.$nextTick(() => {
setTimeout(() => {
this.storeMerchantList(true);
}, 200)
})
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
this.street = '定位失败'
})
}
})
},
}
}
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background-color: #f8fafb !important; background-color: #f8fafb !important;
} }
.wholeSale { .wholeSale {
background-color: #f8fafb !important;
.wholeSale-header-search-wrap {
padding: 30rpx 20rpx 0;
background-color: #fff;
}
.wholeSale-header { .wholeSale-header {
position: sticky;
top: 0;
z-index: 90;
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;
} }
.wholeSale-section { .scrollview-active {
position: sticky; position: relative;
top: calc(82rpx + var(--status-bar-height)); font-weight: bold;
padding: 0rpx 20rpx; font-size: 36rpx;
background-color: #fff; color: #FFFFFF;
transition: height .5s;
overflow: hidden; &::after {
margin-bottom: 20rpx; 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 { .wholeSale-nav {
display: flex; display: flex;
@ -445,6 +54,7 @@
.icon { .icon {
margin-right: 20rpx; margin-right: 20rpx;
} }
}
.search_content { .search_content {
// margin-bottom: 40rpx; // margin-bottom: 40rpx;
@ -481,14 +91,11 @@
color: #fff; 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;
@ -533,99 +140,67 @@
} }
} }
} }
.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 { .cate {
background-color: #fff;
padding: 20rpx;
.popup-wrap-title {
font-size: 36rpx;
color: #333;
font-weight: bold;
margin-bottom: 20rpx;
}
.popup-wrap-category {
width: 100%; width: 100%;
overflow: auto;
margin-bottom: 30rpx;
.popup-wrap-category-wrap { .cate-wrap {
display: flex; display: flex;
flex-wrap: wrap; padding-bottom: 8rpx;
.popup-wrap-category-item { .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; display: flex;
flex-direction: column; justify-content: space-between;
justify-content: center;
align-items: center; align-items: center;
margin: 0 20rpx 20rpx 0; padding: 0 50rpx;
&:nth-child(5n) { [class^=comprehensive-] {
margin-right: 0; display: flex;
} align-items: center;
text { text {
margin-top: 16rpx; margin-right: 12rpx;
font-size: 24rpx; font-size: 26rpx;
color: #666666; color: #666666;
white-space: nowrap;
} }
.popup-wrap-category-item-text { image {
width: 120rpx; width: 28rpx;
text-align: center; height: 28rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
.popup-wrap-category-item-active { .loudou {
position: relative; width: 24rpx;
height: 24rpx;
.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 {
margin: 0 20rpx;
} }
.goods_list { .goods_list {
padding-bottom: 30rpx;
background-color: #f8fafb;
.goods { .goods {
width: 710rpx; width: 710rpx;
height: 200rpx; height: 200rpx;
@ -687,6 +262,7 @@
.score-title { .score-title {
margin-right: 15rpx; margin-right: 15rpx;
} }
.score_text { .score_text {
@ -720,7 +296,7 @@
position: absolute; position: absolute;
top: 70rpx; top: 70rpx;
right: -10rpx; right: -10rpx;
z-index: 101; // background-color: rgba(#000, 0.7);
width: 250rpx; width: 250rpx;
padding: 20rpx; padding: 20rpx;
padding-top: 30rpx; padding-top: 30rpx;
@ -746,3 +322,337 @@
} }
} }
</style> </style>
<template>
<view class="wholeSale">
<!-- 顶部 -->
<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="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;justify-content: space-between;">
<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;position: relative;" @click="changeMap">
<view
style="width: 250rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;text-align: right;">
{{street}}
</view>
<u-icon name="arrow-down" size="14" color="#fff"></u-icon>
<view class="position-address" v-if="isShowAddress" @click.stop="">
<u-icon class="icon" name="close" size="14" @click="closeShowAddress" color="#fff"></u-icon>
<view class="title">
<view>开启定位服务</view>
<view>查看附近商铺</view>
</view>
<view class="btn" @click.stop="getLocation">立即开启</view>
</view>
</view>
</view>
</view>
<!-- 内容 -->
<view class="wholeSale-con" style="padding-top: calc(var(--status-bar-height) + 100rpx);">
<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}&shop=true`)"
hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索店铺名称" :value="where.keyword"
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
</view>
<!-- <button class="search_btn">搜索</button> -->
</view>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.background"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.category_name}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
</view>
<!-- 列表 -->
<view class="goods_list">
<view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar">
<!-- <image style="width: 100%;height: 100%;" :src="item.mer_avatar" mode="aspectFill" lazy-load>
</image> -->
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
</view>
<view class="content">
<view class="content-head">
<view class="title">{{item.mer_name}}</view>
<text style="font-size: 21.03rpx;color: #aaa;" v-if="item.sales>=100">月销{{item.sales}}</text>
</view>
<view class="content-two">
<view class="score">
<view class="star">
<view
:style="{width: `${(item.service_score / 5 * 100).toFixed(0)}%`, backgroundImage: `url(${domain}/static/diy/score1${keyColor}.png)`}">
</view>
</view>
</view>
<text
style="margin-left: 20rpx;color: #FF6D20;font-size: 22.78rpx; ">{{item.service_score}}</text>
<text v-if="item.distance"
style="margin-left: 20rpx;font-size: 21.03rpx;color: #aaa;">{{item.distance}}</text>
<text style="margin-left:20rpx;">{{item.category_name}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text> {{item.service_phone}}</text>
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true"
src="/static/images/GXSC/SJ.png" width="33.85rpx" height="33.85rpx"></u--image>
<text v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text class="address">{{item.mer_address}}</text>
</view>
</view>
</view>
<loadmore :type="isLoading"></loadmore>
</view>
</view>
</template>
<script>
import {
goShopDetail
} from '@/libs/order.js'
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
import {
getGeocoder
} from "@/api/store.js"
import {
merClassifly,
storeMerchantList
} from "@/api/store.js"
import {
configMap
} from '@/utils';
import {
mapGetters
} from "vuex";
import {
HTTP_REQUEST_URL
} from '@/config/app';
import {
Toast
} from '../../../libs/uniApi';
export default {
components: {
WaterfallsFlow
},
data() {
return {
domain: HTTP_REQUEST_URL,
hostProduct: [],
store_category: [], //
cate_change: 0,
goodsList: [],
isLoading: 0,
isShowAddress: false,
street: '定位中',
where: {
page: 1,
limit: 20,
keyword: '',
order: 'location',
type_id: '10,12,21,24',
merchant_category_id: '',
location: ''
}
}
},
computed: {
...configMap({
margin_ico_switch: 0,
margin_ico: '',
mer_location: 0,
store_street_theme: 1,
hide_mer_status: '',
}, mapGetters(['viewColor', 'keyColor'])),
},
onLoad(option) {
let getAddress = uni.getStorageSync('getAddress');
let closeShow = uni.getStorageSync('closeShow');
if (!getAddress && !closeShow) this.isShowAddress = true;
this.street = this.$store.state.storage.address.townName;
if (this.$store.state.storage.location.lat) {
this.where.location =
`${this.$store.state.storage.location.lat},${this.$store.state.storage.location.long}`;
} else if (getAddress) {
this.street = '';
this.getLocation();
} else Toast('点击右上角开启定位后才可获取附近商家')
this.merClassifly();
this.storeMerchantList();
},
onReachBottom() {
this.storeMerchantList();
},
onPageScroll() {
uni.$emit('scroll');
},
methods: {
navTo(url) {
uni.navigateTo({
url: url,
success: () => {
uni.$once('searchValue', (e) => {
this.$nextTick(() => {
this.where.keyword = e;
this.storeMerchantList(true);
})
})
}
})
},
navBack() {
uni.navigateBack();
},
tabsChange(e) {
this.tabsCurr = e;
},
changeCate(e) {
this.cate_change = e;
this.where.merchant_category_id = this.store_category[e].merchant_category_id;
this.storeMerchantList(true);
},
//
goStore(id) {
uni.navigateTo({
url: `/pages/store/home/index?id=${id}`
})
},
merClassifly() {
merClassifly().then(res => {
this.store_category = [{
category_name: '全部',
merchant_category_id: '',
background: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0bc7a202404021652194310.png'
}, ...res.data];
})
},
storeMerchantList(reLoad = false) {
if (reLoad) {
this.where.page = 1;
this.goodsList = [];
this.isLoading = 0;
}
if (this.isLoading == -1) return;
this.isLoading = 1;
storeMerchantList(this.where).then(res => {
this.goodsList = [...this.goodsList, ...res.data.list];
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
this.where.page++;
})
},
closeShowAddress() {
this.isShowAddress = false;
uni.setStorageSync('closeShow', true);
},
//
changeMap() {
uni.navigateTo({
url: `/pages/select_address_n/select_address_n`,
success: () => {
uni.$once('changeAddress', (e) => {
this.isShowAddress = false;
uni.setStorageSync('closeShow', true);
this.street = e.street.name;
this.$store.commit('setAddress', {
street_id: e.street.code,
townName: e.street.name
});
if (e.longitude) {
let latitude = e.latitude;
let longitude = e.longitude;
this.where.location = `${latitude},${longitude}`;
this.$store.commit('setLocation', {
lat: e.latitude,
long: e.longitude,
});
this.$nextTick(() => {
setTimeout(() => {
this.storeMerchantList(true);
}, 200)
})
}
})
}
})
},
getLocation() {
uni.getLocation({
type: 'gcj02',
success: (res) => {
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
this.$store.commit('setLocation', {
lat: res.latitude.toFixed(6),
long: res.longitude.toFixed(6),
});
this.isShowAddress = false;
uni.setStorageSync('closeShow', true);
uni.setStorageSync('getAddress', true);
getGeocoder({
lat: latitude,
long: longitude
}).then(res => {
let town = res.data.address_reference.town.title
let street_id = street_id = res.data.address_reference.town.id
this.street = res.data.address_reference.town.title;
this.$store.commit('setAddress', {
street_id: street_id,
townName: town
});
uni.$emit('getLocation_succees', {
street_id,
});
this.where.location = `${latitude},${longitude}`;
this.$nextTick(() => {
setTimeout(() => {
this.storeMerchantList(true);
}, 200)
})
}).catch(err => {
uni.showToast({
title: err,
icon: 'none'
})
this.street = '定位失败'
})
}
})
},
}
}
</script>

View File

@ -1,314 +1,61 @@
<template>
<view class="wholeSale">
<!-- 适配不同机 -->
<view class="wholeSale-header">
<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;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>
</view>
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-nav">
<!-- 搜索 -->
<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 class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索商品名称" :value="where.keyword"
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
</view>
</view>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="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="category-item-text">{{item.cate_name}}</text>
</view>
</block>
</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 class="cate" v-if="store_category_children.length>1">
<scroll-view scroll-x="true">
<view class="cate-wrap">
<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)">
<text>{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
</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%;"
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
<view>
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading" style="padding: 12rpx 0;"></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>
</template>
<script>
import {
goShopDetail
} from '@/libs/order.js'
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
import {
getCategoryIndexList,
getProductslist
} from "@/api/store.js"
export default {
components: {
WaterfallsFlow
},
data() {
return {
hostProduct: [],
store_category: [], //
store_category_children: [], //
cate_change: 0,
cate_change_children: 0,
isLoading: 0,
where: {
page: 1,
limit: 20,
cate_pid: '',
keyword: '',
mer_type: 3, //1-, 2-, 3-
sale_type: 1, //1-, 2-
},
wrapHeight: 300,
scrollTop: 0,
isTriggered: true
}
},
onLoad(option) {
this.getCategoryIndexList();
this.getProductslist(true);
},
onPageScroll() {
uni.$emit('scroll');
},
methods: {
//
onPulling() {
if (!this.isTriggered) {
this.isTriggered = true;
this.getProductslist(true);
}
},
onRefresh(e) {
this.isTriggered = true;
},
onScrollBottom(e) {
this.getProductslist();
},
onAllCategory() {
this.$refs.popup.open();
},
onScroll(e) {
if (this.scrollTop > e.target.scrollTop) { //
this.wrapHeight = 300;
} else {
this.wrapHeight = 0;
}
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 => {
this.isTriggered = false;
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(() => {
this.isTriggered = false;
})
},
goDetail(item) {
goShopDetail(item, this.uid).then(res => {
if (this.isLogin) {
initiateAssistApi(item.activity_id).then(res => {
let id = res.data.product_assist_set_id;
uni.hideLoading();
uni.navigateTo({
url: '/pages/activity/assist_detail/index?id=' + id
});
}).catch((err) => {
uni.showToast({
title: err,
icon: 'none'
})
});
} else {
toLogin();
}
})
}
}
}
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background-color: #f8fafb !important; background-color: #f8fafb !important;
} }
.wholeSale { .wholeSale {
background-color: #f8fafb !important;
.wholeSale-header { .wholeSale-header {
position: sticky; margin-bottom: 20rpx;
top: 0; // background-color: #40AE36;
z-index: 90;
background-color: #40AE36; .scrollview {
display: flex;
align-items: center;
height: 98rpx;
padding-left: 32rpx;
.scrollview-item {
margin-right: 30rpx;
font-size: 28rpx;
color: #FFFFFF;
} }
.wholeSale-section { .scrollview-active {
position: sticky; position: relative;
top: calc(82rpx + var(--status-bar-height)); font-weight: bold;
padding: 0rpx 20rpx; font-size: 36rpx;
background-color: #fff; color: #FFFFFF;
transition: height .5s;
overflow: hidden; &::after {
margin-bottom: 20rpx; content: "";
padding-top: 20rpx; display: inline-block;
z-index: 20; position: absolute;
bottom: -6rpx;
left: 50%;
transform: translateX(-50%);
width: 100%;
height: 6rpx;
background-color: #FFFFFF;
}
}
}
}
.wholeSale-con {
margin: 0 20rpx;
.wholeSale-nav{ .wholeSale-nav{
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 40rpx; margin-bottom: 40rpx;
.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;
@ -342,14 +89,11 @@
color: #fff; 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;
@ -394,94 +138,274 @@
} }
} }
} }
.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 { .cate {
background-color: #fff;
padding: 20rpx;
.popup-wrap-title {
font-size: 36rpx;
color: #333;
font-weight: bold;
margin-bottom: 20rpx;
}
.popup-wrap-category {
width: 100%; width: 100%;
overflow: auto;
margin-bottom: 30rpx;
.popup-wrap-category-wrap { .cate-wrap {
display: flex; display: flex;
flex-wrap: wrap; padding-bottom: 8rpx;
.popup-wrap-category-item { .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; display: flex;
flex-direction: column; justify-content: space-between;
justify-content: center;
align-items: center; align-items: center;
margin: 0 20rpx 20rpx 0; padding: 0 50rpx;
&:nth-child(5n) { [class^=comprehensive-] {
margin-right: 0; display: flex;
} align-items: center;
text { text {
margin-top: 16rpx; margin-right: 12rpx;
font-size: 24rpx; font-size: 26rpx;
color: #666666; color: #666666;
white-space: nowrap;
} }
.popup-wrap-category-item-text { image {
width: 120rpx; width: 28rpx;
text-align: center; height: 28rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
.popup-wrap-category-item-active { .loudou {
position: relative; width: 24rpx;
height: 24rpx;
.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> </style>
<template>
<view class="wholeSale">
<!-- 顶部 -->
<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="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>
</view>
<!-- 内容 -->
<view class="wholeSale-con" style="padding-top: calc(var(--status-bar-height) + 100rpx);">
<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 class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索商品名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;"
disabled style="pointer-events: none;">
</view>
<!-- <button class="search_btn">搜索</button> -->
</view>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
<u--image class="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="category-item-text">{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
<!-- 商品小分类 -->
<view class="cate" v-if="store_category_children.length>1">
<scroll-view scroll-x="true">
<view class="cate-wrap">
<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)">
<text>{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-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>
</template>
<script>
import {
goShopDetail
} from '@/libs/order.js'
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
import {
getCategoryIndexList,
getProductslist
} from "@/api/store.js"
export default {
components: {
WaterfallsFlow
},
data() {
return {
hostProduct: [],
store_category: [], //
store_category_children: [], //
cate_change: 0,
cate_change_children: 0,
isLoading: 0,
where: {
page: 1,
limit: 20,
cate_pid: '',
keyword: '',
mer_type: 3, //1-, 2-, 3-
sale_type: 1, //1-, 2-
}
}
},
onLoad(option){
this.getCategoryIndexList();
this.getProductslist(true);
},
onReachBottom() {
this.getProductslist();
},
onPageScroll() {
uni.$emit('scroll');
},
methods: {
navTo(url){
uni.navigateTo({
url:url,
success: () => {
uni.$once('searchValue', (e)=>{
this.$nextTick(()=>{
this.where.keyword = e;
this.getProductslist(true);
})
})
}
})
},
navBack(){
uni.navigateBack();
},
tabsChange(e) {
this.tabsCurr = e;
},
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) {
goShopDetail(item, this.uid).then(res => {
if (this.isLogin) {
initiateAssistApi(item.activity_id).then(res => {
let id = res.data.product_assist_set_id;
uni.hideLoading();
uni.navigateTo({
url: '/pages/activity/assist_detail/index?id=' + id
});
}).catch((err) => {
uni.showToast({
title: err,
icon: 'none'
})
});
} else {
toLogin();
}
})
}
}
}
</script>

View File

@ -130,7 +130,7 @@
} }
</style> </style>
<template> <template>
<view class="gather" @click.stop="clickWhite"> <view class="gather">
<!--顶部定位--> <!--顶部定位-->
<view class="gather-header"> <view class="gather-header">
<view style="height: var(--status-bar-height);"></view> <view style="height: var(--status-bar-height);"></view>
@ -144,10 +144,8 @@
<view style="margin-right: 30rpx;" @click="scanQRcode" hover-class="none"> <view style="margin-right: 30rpx;" @click="scanQRcode" hover-class="none">
<view class="iconfont icon-saoma" style="color:#fff;font-size:40rpx;"> </view> <view class="iconfont icon-saoma" style="color:#fff;font-size:40rpx;"> </view>
</view> </view>
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none" <navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
style="position: relative;">
<view class="iconfont icon-xiaoxi" style="color:#fff;font-size:40rpx;"> </view> <view class="iconfont icon-xiaoxi" style="color:#fff;font-size:40rpx;"> </view>
<text class="iconnum" v-if="userInfoData.user_unread">{{userInfoData.user_unread}}</text>
</navigator> </navigator>
</view> </view>
</view> </view>
@ -175,26 +173,27 @@
</view> </view>
</view> </view>
</view> </view>
<view class="title-img"> <view class="title-img">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/807b8202403111125379295.webp" mode=""></image> <image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/807b8202403111125379295.webp" mode=""></image>
</view> </view>
<view class="business com special_work" v-if="jurisdiction == false"> <view class="business com special_work" v-if="jurisdiction == false">
<view class="content"> <view class="content">
<block v-if="nowMenuList.length > 0"> <block v-if="nowMenuList.length > 0">
<u-transition v-for="(item, index) in nowMenuList" :key="item.name" show> <u-transition v-for="(item, index) in nowMenuList" :key="item.name" show>
<view class="examine" @click.stop="editFlag ? removeMenu(item) : clickMenu(item)" <view class="examine" @click="editFlag ? removeMenu(item) : clickMenu(item)">
@longpress="editFlag = true"> <image class="icon_img" :src="item.pic" mode="aspectFit">
<image class="icon_img gatherDiver" :src="item.pic" mode="aspectFit">
</image> </image>
<!-- <u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon> --> <!-- <u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon> -->
<view v-if="editFlag" class="icon" style="background-color: red;">删除</view> <view v-if="editFlag" class="icon" style="background-color: red;">隐藏</view>
<text class="text">{{ item.name }}</text> <text class="text">{{ item.name }}</text>
</view> </view>
</u-transition> </u-transition>
</block> </block>
<view class="add-box examine" <view class="add-box examine"
style="display: flex;justify-content: center;flex-direction: column;align-items: center;" style="display: flex;justify-content: center;flex-direction: column;align-items: center;"
@click.stop="editFlag = true" @longpress="editFlag = true" v-if="!editFlag"> @click="editFlag = true">
<view class="add-box-icon" <view class="add-box-icon"
style="margin-bottom: 14rpx; width:84rpx;height:84rpx;border: 2rpx solid #40AE36;border-radius: 10rpx;display: flex;justify-content: center;align-items: center;"> style="margin-bottom: 14rpx; width:84rpx;height:84rpx;border: 2rpx solid #40AE36;border-radius: 10rpx;display: flex;justify-content: center;align-items: center;">
<u-icon name="plus" size="25" :bold="true" color="#40AE36"></u-icon> <u-icon name="plus" size="25" :bold="true" color="#40AE36"></u-icon>
@ -210,7 +209,7 @@
</view> </view>
<view class="content"> <view class="content">
<u-transition v-for="(item, index) in AllMenuList" :key="item.name" show> <u-transition v-for="(item, index) in AllMenuList" :key="item.name" show>
<view class="examine" @click.stop="pushMenu(item)"> <view class="examine" @click="pushMenu(item)">
<image class="icon_img" :src="item.pic" mode="aspectFit"> </image> <image class="icon_img" :src="item.pic" mode="aspectFit"> </image>
<!-- <u-icon class="icon" name="plus-circle-fill"></u-icon> --> <!-- <u-icon class="icon" name="plus-circle-fill"></u-icon> -->
<view class="icon">添加</view> <view class="icon">添加</view>
@ -248,9 +247,6 @@
} from "@/api/public"; } from "@/api/public";
// #ifdef APP-PLUS // #ifdef APP-PLUS
import uniMP from '@/utils/uniMP.js'; import uniMP from '@/utils/uniMP.js';
import {
isNewMer
} from '@/api/user.js';
// #endif // #endif
export default { export default {
@ -259,8 +255,6 @@
}, },
data() { data() {
return { return {
subNVue: null,
elInfo: '',
imgUrls: [{ imgUrls: [{
img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e2f0520240203154207556.png' img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e2f0520240203154207556.png'
}], }],
@ -290,76 +284,33 @@
backColor: 'rgba(252, 252, 252, 0)', backColor: 'rgba(252, 252, 252, 0)',
newData: {}, newData: {},
activeRouter: '', activeRouter: '',
// userInfo: {},
}; };
}, },
computed: { computed: {
...mapGetters(['userInfo', 'location', 'isLogin']) ...mapGetters(['userInfo', 'location', 'isLogin'])
}, },
created() {}, created() {},
onLoad() { onLoad() {},
this.subNVue = uni.getSubNVueById('concat')
let that = this
uni.$on('diverGatherSubEmit', function(data) {
that.clickMenu(that.nowMenuList[0])
})
},
onShow() { onShow() {
let that = this
this.street = this.$store.state.storage.address.townName; this.street = this.$store.state.storage.address.townName;
this.getNav(); this.getNav();
if (this.isLogin) { if (this.isLogin) {
this.emptyText = '暂无可用应用' this.emptyText = '暂无可用应用'
this.jurisdiction = false this.jurisdiction = false
this.initAllAppLet(true); this.initAllAppLet();
} else { } else {
this.emptyText = '请登录' this.emptyText = '请登录'
this.jurisdiction = true this.jurisdiction = true
} }
this.getUserInfo(); this.getUserInfo();
this.imgUrls = uni.getStorageSync('swiperImgList'); this.imgUrls = uni.getStorageSync('swiperImgList');
// 2024/04/28
let menu = uni.getStorageSync('gatherMenuList');
if (menu) {
menu = JSON.parse(menu);
} else {
menu = [];
}
this.nowMenuList = menu;
// #ifdef APP-PLUS
if (Boolean(this.userInfo.service?.mer_id)) {
isNewMer(this.userInfo.uid, this.userInfo.service?.mer_id).then(
res => {
if (res.data == 'true') {
setTimeout(() => {
const query = uni.createSelectorQuery().in(this);
query
.select(".gatherDiver")
.boundingClientRect((data) => {
let info = JSON.stringify(data)
that.elInfo = data
that.openDiver()
})
.exec();
}, 500)
}
})
}
// #endif
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getUserInfo() this.getUserInfo()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
beforeDestroy() {}, beforeDestroy() {},
onReady() { mounted() {},
// #ifdef APP-PLUS
// #endif
},
// #ifdef APP-PLUS // #ifdef APP-PLUS
onPageScroll(e) { onPageScroll(e) {
const scrollTop = e.scrollTop; const scrollTop = e.scrollTop;
@ -378,18 +329,7 @@
onHide() { onHide() {
uni.$emit('showLoading', false); uni.$emit('showLoading', false);
}, },
watch: {
nowMenuList(newVal, oldVal) {
if (newVal) {
uni.setStorageSync('gatherMenuList', JSON.stringify(newVal));
}
}
},
methods: { methods: {
openDiver() {
this.subNVue.show('zoom-out', 300)
uni.$emit('diverGatherEmit', this.elInfo);
},
changeSwiper(e){ changeSwiper(e){
if(e.length>0 && e[1].value){ if(e.length>0 && e[1].value){
uni.navigateTo({ uni.navigateTo({
@ -464,13 +404,13 @@
} }
}) })
}, },
initAllAppLet(flag) { initAllAppLet() {
applet().then(res => { applet().then(res => {
this.AllMenuList = res.data; this.AllMenuList = res.data;
this.initMenu(flag); this.initMenu();
this.showControllerAllLet(); this.showControllerAllLet();
}).catch(e => { }).catch(e => {
// console.log(e); console.log(e);
}) })
}, },
// //
@ -484,7 +424,7 @@
} }
}, },
// //
initMenu(flag = false) { initMenu() {
let nowMenu = uni.getStorageSync('gatherMenuList'); let nowMenu = uni.getStorageSync('gatherMenuList');
try { try {
let list = JSON.parse(nowMenu || '[]'); let list = JSON.parse(nowMenu || '[]');
@ -494,12 +434,8 @@
if (list.find(t => t.name == item.name)?.name != item.name) all.push(item); if (list.find(t => t.name == item.name)?.name != item.name) all.push(item);
else now.push(item) else now.push(item)
}) })
if (flag && !now.length) {
this.$set(now, 0, all[0])
}
this.AllMenuList = all; this.AllMenuList = all;
this.nowMenuList = now; this.nowMenuList = now;
} catch (e) { } catch (e) {
this.nowMenuList = []; this.nowMenuList = [];
} }
@ -528,6 +464,7 @@
}, },
getUniMp(data) { getUniMp(data) {
let that = this; let that = this;
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (data.version) return uniMP.loadAppletMP(data); if (data.version) return uniMP.loadAppletMP(data);
else switch (data.type) { else switch (data.type) {
@ -547,6 +484,14 @@
return; return;
// #endif // #endif
// #ifdef H5 // #ifdef H5
// if (type == 2) {
// this.navigator(`/pages/moreProject/moreProject`);
// } else {
// uni.showToast({
// icon: 'none',
// title: 'H5'
// })
// }
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: 'H5不支持打开小程序' title: 'H5不支持打开小程序'
@ -555,6 +500,7 @@
}, },
navigator(url, t) { navigator(url, t) {
// if (this.userInfoData.is_wsxx === 0 && t != '') return Toast("");
uni.navigateTo({ uni.navigateTo({
url: url url: url
}) })
@ -562,8 +508,6 @@
getUserInfo: function() { getUserInfo: function() {
let that = this; let that = this;
getUserInfo().then(res => { getUserInfo().then(res => {
showTab(res.data);
that.userInfo = res.data;
that.userInfoData = res.data; that.userInfoData = res.data;
that.$store.commit('SET_USERINFO', res.data); that.$store.commit('SET_USERINFO', res.data);
// console.log(res.data.service); // console.log(res.data.service);
@ -580,10 +524,6 @@
} }
}); });
}, },
//
clickWhite() {
if (this.editFlag) this.editFlag = false;
}
} }
}; };
</script> </script>
@ -642,18 +582,6 @@
} }
} }
.iconnum {
min-width: 14rpx;
color: #fff;
background: #E93323;
border-radius: 15rpx;
position: absolute;
left: 20rpx;
top: -10rpx;
font-size: 10px;
padding: 0 5px;
}
.site-box { .site-box {
width: 100%; width: 100%;
/* #ifdef MP || APP-PLUS */ /* #ifdef MP || APP-PLUS */

View File

@ -1,191 +0,0 @@
<template>
<view class="" style="width: 750rpx;height: 100%;">
<view class="jump" @click="jump">
<text class="font">跳过</text>
</view>
<view class="tabbar" :style="{top:(top-12)+'px',left:(left-12)+'px'}">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0fa43202312291702314919.png" class="tab-icon">
</image>
</view>
<view class="" class="pointe" :style="{ left:(left-10)+'px',top:(top)+'px'}">
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;" mode=""></image>
</view>
<view class="center" :style="{left:(left+20)+'px', top:(top+55)+'px'}">
<image src="/static/images/greenLineDown.png" style="width:35px;height: 60px;" mode=""></image>
</view>
<view class="tips-box" :style="{ left:left+'px',top:(top+80)+'px'}">
<view class="tips" style="position: absolute;padding-left: 10rpx;">
<view class="tras" :class="{act:isActive}">
<text style="font-size: 28rpx;line-height: 100rpx;color: white;">点击供销助农平台进入商户平台</text>
</view>
</view>
<image src="/static/images/starpng.png" class="start" mode="">
</image>
</view>
<view class="next-btn center">
<text class="next-btn-text font" @click="next">下一步(2/4)</text>
</view>
</view>
</template>
<script>
import {
isNewMer
} from '@/api/user.js';
export default {
data() {
return {
isActive: false,
left: 0,
top: 0,
subNVue: null,
offsetX: 0,
offsetY: 0,
iconWidth: 0,
}
},
methods: {
next() {
this.subNVue.hide('zoom-in', 300, )
setTimeout(() => {
uni.$emit('diverGatherSubEmit');
}, 500)
},
jump() {
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id, {
done: 1
}).then(res => {
console.log(res, 'res')
})
}
},
onLoad() {
let that = this
this.subNVue = uni.getSubNVueById('concat')
uni.$on('diverGatherEmit', (data) => {
that.left = data.left
that.top = data.top
})
setTimeout(() => {
that.isActive = true
}, 500)
}
}
</script>
<style>
.jump {
position: absolute;
right: 30rpx;
top: 80rpx;
border: 1px solid white;
padding: 10rpx 20rpx;
border-radius: 30rpx;
}
/* .tips {
width: 462rpx;
height: 106rpx;
background-color: #5BE157;
border-radius: 20rpx;
} */
.tips-box {
width: 462rpx;
height: 178rpx;
position: absolute;
padding-top: 72rpx;
position: absolute;
}
.start {
width: 72rpx;
height: 72rpx;
position: absolute;
right: 0;
top: 20px;
}
.tips {
width: 462rpx;
height: 106rpx;
background-color: #5BE157;
border-radius: 20rpx;
}
.center {
position: absolute;
left: 375rpx;
transform: translateX(-50%);
}
.tabbar {
width: 136rpx;
height: 136rpx;
background-color: white;
border-radius: 136rpx;
position: absolute;
}
.tab-icon {
width: 50rpx;
height: 50rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, -50%);
top: 68rpx;
}
.te {
font-size: 20rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, 0);
top: 100rpx;
}
.pointe {
position: absolute;
}
.tras {
padding-left: 10rpx;
position: absolute;
z-index: 999 !important;
width: 20px;
transition-property: width;
transition-duration: 3s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.act {
width: 462rpx;
}
.font {
font-size: 28rpx;
color: white;
lines: 1;
}
.next-btn {
position: absolute;
bottom: 100px;
left: 375rpx;
transform: translateX(-50%);
width: 240rpx;
height: 76rpx;
border: 1px solid white;
border-radius: 38rpx;
background-color: rgba(255, 255, 255, 0.4);
}
.next-btn-text {
line-height: 76rpx;
text-align: center;
}
</style>

View File

@ -26,13 +26,11 @@
<productConSwiper :imgUrls="storeInfo.slider_image" :videoCoverImg="videoCoverImg" <productConSwiper :imgUrls="storeInfo.slider_image" :videoCoverImg="videoCoverImg"
:videoline="storeInfo.video_link"></productConSwiper> :videoline="storeInfo.video_link"></productConSwiper>
<!--有氛围图--> <!--有氛围图-->
<view v-if="storeInfo.atmosphere_pic" <view v-if="storeInfo.atmosphere_pic" :style="{ backgroundImage: `url(${storeInfo.atmosphere_pic})` }"
:style="{ backgroundImage: `url(${storeInfo.atmosphere_pic})` }"
class='nav acea-row row-between-wrapper'> class='nav acea-row row-between-wrapper'>
<view class='money skeleton-rect'><text class='num'>{{storeInfo.price}}</text> <view class='money skeleton-rect'><text class='num'>{{storeInfo.price}}</text>
<text v-if="!svipData" class='y-money'>{{storeInfo.ot_price}}</text> <text v-if="!svipData" class='y-money'>{{storeInfo.ot_price}}</text>
<view class="atmosphere" <view class="atmosphere" v-if="svipData && svipData.show_svip_price && svipData.show_svip"
v-if="svipData && svipData.show_svip_price && svipData.show_svip"
style="display: inline-block;"> style="display: inline-block;">
<text class="vip-money">{{storeInfo.svip_price}}</text> <text class="vip-money">{{storeInfo.svip_price}}</text>
<image class="vip-image" :src="`${domain}/static/images/svip.png`"></image> <image class="vip-image" :src="`${domain}/static/images/svip.png`"></image>
@ -50,15 +48,12 @@
</view> </view>
<view class="fenxiang_btn"> <view class="fenxiang_btn">
<view @click="setCollect"><text class="iconfont" <view @click="setCollect"><text class="iconfont"
:class="storeInfo.isRelation ? 'icon-yishoucang2' : 'icon-shoucang4'"></text><br />收藏 :class="storeInfo.isRelation ? 'icon-yishoucang2' : 'icon-shoucang4'"></text><br />收藏</view>
</view> <view @click="listenerActionSheet"><text class="iconfont icon-fenxiang4"></text><br />分享</view>
<view @click="listenerActionSheet"><text
class="iconfont icon-fenxiang4"></text><br />分享</view>
</view> </view>
</view> </view>
<view v-if="storeInfo.atmosphere_pic" class='integral_count skeleton-rect'> <view v-if="storeInfo.atmosphere_pic" class='integral_count skeleton-rect'>
<text v-if="storeInfo.max_integral > 0" <text v-if="storeInfo.max_integral > 0" class='integral'>积分最高可抵扣{{storeInfo.max_integral}}</text>
class='integral'>积分最高可抵扣{{storeInfo.max_integral}}</text>
<text v-if="storeInfo.delivery_free == 1" class='integral'>包邮</text> <text v-if="storeInfo.delivery_free == 1" class='integral'>包邮</text>
</view> </view>
<!--无氛围图--> <!--无氛围图-->
@ -66,8 +61,7 @@
<view class='money p-color skeleton-rect' style="min-width: 70rpx;"> <view class='money p-color skeleton-rect' style="min-width: 70rpx;">
<text class='num'>{{storeInfo.price}}</text> <text class='num'>{{storeInfo.price}}</text>
<text style="color: #000;font-weight: 500;" <text style="color: #000;font-weight: 500;" v-if="storeInfo.attr&&storeInfo.attr.length==0&&storeInfo.unit_name!='无'">/{{ storeInfo.unit_name}}</text>
v-if="storeInfo.attr&&storeInfo.attr.length==0&&storeInfo.unit_name!='无'">/{{ storeInfo.unit_name}}</text>
<text style="color: #000;font-weight: 500;" v-else>{{" "}}</text> <text style="color: #000;font-weight: 500;" v-else>{{" "}}</text>
<view v-if="svipData && svipData.show_svip_price && svipData.show_svip" <view v-if="svipData && svipData.show_svip_price && svipData.show_svip"
style="display: inline-block;"> style="display: inline-block;">
@ -79,26 +73,23 @@
<view @click="setCollect" <view @click="setCollect"
style="display: flex;flex-direction: column;justify-content: center;align-items: center;"> style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
<!-- <text class="iconfont" :class="storeInfo.isRelation ? 'icon-yishoucang2' : 'icon-shoucang4'"></text><br/> --> <!-- <text class="iconfont" :class="storeInfo.isRelation ? 'icon-yishoucang2' : 'icon-shoucang4'"></text><br/> -->
<u-icon :name="storeInfo.isRelation?'star-fill':'star'" <u-icon :name="storeInfo.isRelation?'star-fill':'star'" color="#F55726"></u-icon>
color="#F55726"></u-icon>
收藏 收藏
</view> </view>
<!-- <view @click="listenerActionSheet"><text class="iconfont icon-fenxiang4"></text><br/>分享</view> --> <!-- <view @click="listenerActionSheet"><text class="iconfont icon-fenxiang4"></text><br/>分享</view> -->
</view> </view>
</view> </view>
<view v-if="!storeInfo.atmosphere_pic" class='integral_count skeleton-rect' style="">
<text v-if="storeInfo.max_integral > 0" class='integral' <view v-if="!storeInfo.atmosphere_pic" class='integral_count skeleton-rect'
style="margin-top: 0;">积分最高可抵扣{{storeInfo.max_integral}}</text> style="">
<text v-if="storeInfo.delivery_free == 1" class='integral' <text v-if="storeInfo.max_integral > 0" class='integral' style="margin-top: 0;">积分最高可抵扣{{storeInfo.max_integral}}</text>
style="margin-top: 0;">包邮</text> <text v-if="storeInfo.delivery_free == 1" class='integral' style="margin-top: 0;">包邮</text>
</view> </view>
<view v-if="showPriceTabs" class='share acea-row row-top' <view v-if="showPriceTabs" class='share acea-row row-top' style="flex-wrap: wrap;padding-top: 0rpx;">
style="flex-wrap: wrap;padding-top: 0rpx;">
<view class='money p-color skeleton-rect price-tab'>规格: </view> <view class='money p-color skeleton-rect price-tab'>规格: </view>
<view class='money p-color skeleton-rect price-tab' <view class='money p-color skeleton-rect price-tab' v-for="(item, index) in storeInfo.sku" @click="selecAttr">
v-for="(item, index) in storeInfo.sku" @click="selecAttr">
<text class='num' style="font-size: 28rpx;">{{item.price}}</text> <text class='num' style="font-size: 28rpx;">{{item.price}}</text>
<text style="font-size: 26rpx;">{{"/"}}{{ item.sku || storeInfo.unit_name}}</text> <text style="font-size: 26rpx;">{{"/"}}{{ item.sku || storeInfo.unit_name}}</text>
@ -110,8 +101,7 @@
<view class="acea-row row-between-wrapper"> <view class="acea-row row-between-wrapper">
<image :src="`${domain}/static/images/svip_user.png`"></image> <image :src="`${domain}/static/images/svip_user.png`"></image>
<view class="">开通 SVIP会员 <view class="">开通 SVIP会员
<block v-if="svipData.show_svip_price">立省<text>{{svipData.save_money}}</text> <block v-if="svipData.show_svip_price">立省<text>{{svipData.save_money}}</text></block>
</block>
<block v-else><text>省钱多多权益多多</text></block> <block v-else><text>省钱多多权益多多</text></block>
</view> </view>
</view> </view>
@ -120,8 +110,7 @@
<text class="iconfont icon-jiantou"></text> <text class="iconfont icon-jiantou"></text>
</navigator> </navigator>
</view> </view>
<view v-if="!storeInfo.atmosphere_pic" class='introduce skeleton-rect' <view v-if="!storeInfo.atmosphere_pic" class='introduce skeleton-rect' style="padding-bottom: 20rpx;margin-top: 10rpx;">
style="padding-bottom: 20rpx;margin-top: 10rpx;">
<!-- <text v-if="storeInfo.merchant.type_name" class="font-bg-red bt-color">{{storeInfo.merchant.type_name}}</text> <!-- <text v-if="storeInfo.merchant.type_name" class="font-bg-red bt-color">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="storeInfo.merchant.is_trader" class="font-bg-red bt-color">自营</text> --> <text v-else-if="storeInfo.merchant.is_trader" class="font-bg-red bt-color">自营</text> -->
{{storeInfo.store_name || ''}} {{storeInfo.store_name || ''}}
@ -153,13 +142,18 @@
</view> </view>
<view class='wrapper' v-if="storeInfo.store_info" style="padding: 28rpx;"> <view class='wrapper' v-if="storeInfo.store_info" style="padding: 28rpx;">
<view style="padding-bottom: 20rpx;">基础信息</view> <view style="padding-bottom: 20rpx;">基础信息</view>
<view style="white-space: pre-wrap;color: #666666;font-size: 26rpx;border-radius: 14rpx;"> <view
{{storeInfo.store_info}} style="white-space: pre-wrap;color: #666666;font-size: 26rpx;border-radius: 14rpx;">
{{storeInfo.store_info}}</view>
</view> </view>
<!-- <view class='attribute acea-row row-between-wrapper skeleton-rect'>
<view class="acea-row row-between-wrapper">{{attrTxt}}
<text class='atterTxt'>{{attrValue}}</text>
</view> </view>
<view class='iconfont icon-jiantou'></view>
<view v-if="specsInfo.params && specsInfo.params.length>0" </view> -->
class="attribute acea-row row-between-wrapper" @click="seeSpecs"> <view v-if="specsInfo.params && specsInfo.params.length>0" class="attribute acea-row row-between-wrapper"
@click="seeSpecs">
<view class="acea-row row-middle"> <view class="acea-row row-middle">
参数 参数
<view class="list line1"> <view class="list line1">
@ -171,8 +165,7 @@
<view class="iconfont icon-jiantou"></view> <view class="iconfont icon-jiantou"></view>
</view> </view>
<!--运费--> <!--运费-->
<view v-if="shipping || shippingValue" class='attribute acea-row row-between-wrapper' <view v-if="shipping || shippingValue" class='attribute acea-row row-between-wrapper' @click="showShip">
@click="showShip">
<view class="acea-row row-between-wrapper">运费 <view class="acea-row row-between-wrapper">运费
<text class='atterTxt'>{{shippingValue}}</text> <text class='atterTxt'>{{shippingValue}}</text>
</view> </view>
@ -205,8 +198,7 @@
show-scrollbar="false"> show-scrollbar="false">
<view class="img-box"> <view class="img-box">
<view class="combo_item" v-for="(item,index) in comboList" :key="index"> <view class="combo_item" v-for="(item,index) in comboList" :key="index">
<view class="img-item" v-for="(itemn,indexn) in item.discountsProduct" <view class="img-item" v-for="(itemn,indexn) in item.discountsProduct" :key="indexn">
:key="indexn">
<image :src="itemn.image" mode="" @click="openCombo"></image> <image :src="itemn.image" mode="" @click="openCombo"></image>
<text v-if="indexn != item.count-1" class="iconfont icon-jiahao2"></text> <text v-if="indexn != item.count-1" class="iconfont icon-jiahao2"></text>
</view> </view>
@ -242,11 +234,10 @@
</navigator> </navigator>
</view> </view>
<view class="imgList acea-row"> <view class="imgList acea-row">
<view class="pictrue" v-for="(item, index) in storeInfo.community" :key="index" <view class="pictrue" v-for="(item, index) in storeInfo.community" :key="index" v-if="index<=2"
v-if="index<=2" @click="goPlant(item)"> @click="goPlant(item)">
<image :src="item.image[0]" class="image"></image> <image :src="item.image[0]" class="image"></image>
<image v-if="item.is_type == 2" class="video_img" src="@/static/images/stop.png" <image v-if="item.is_type == 2" class="video_img" src="@/static/images/stop.png" mode=""></image>
mode=""></image>
</view> </view>
</view> </view>
</view> </view>
@ -254,25 +245,27 @@
<view class="store-wrapper" v-if="storeInfo.merchant && hide_mer_status !=1"> <view class="store-wrapper" v-if="storeInfo.merchant && hide_mer_status !=1">
<view class="store-hd skeleton-rect"> <view class="store-hd skeleton-rect">
<view v-if="storeInfo.merchant&&hide_mer_status != 1" class="store-info"> <view v-if="storeInfo.merchant&&hide_mer_status != 1" class="store-info">
<navigator <navigator :url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`"
:url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`"
hover-class="none" class="logo"> hover-class="none" class="logo">
<image :src="storeInfo.merchant.mer_avatar" mode=""></image> <image :src="storeInfo.merchant.mer_avatar" mode=""></image>
</navigator> </navigator>
<navigator <navigator :url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`"
:url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`"
hover-class="none" class="info"> hover-class="none" class="info">
<view class="name line1"> <view class="name line1">
<text class="line1" <text>{{storeInfo.merchant.mer_name ? storeInfo.merchant.mer_name : ''}}</text>
style="max-width:450rpx;">{{storeInfo.merchant.mer_name ? storeInfo.merchant.mer_name : ''}}</text> <image v-if="margin_ico_switch==1 && margin_ico && storeInfo.merchant.is_margin == 10"
<image
v-if="margin_ico_switch==1 && margin_ico && storeInfo.merchant.is_margin == 10"
:src="margin_ico" class="store-margin"></image> :src="margin_ico" class="store-margin"></image>
<!-- <text v-if="storeInfo.merchant.type_name" class="font-bg-red ml8 bt-color">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="storeInfo.merchant.is_trader" class="font-bg-red ml8 bt-color">自营</text> -->
</view> </view>
<!-- <view v-if="storeInfo.merchant.care_count" class="txt">
{{storeInfo.merchant.care_count < 10000 ? storeInfo.merchant.care_count : (storeInfo.merchant.care_count/10000).toFixed(2)+'万'}}人关注
</view>
<view v-else class="txt">0人关注</view> -->
</navigator> </navigator>
<navigator v-if="hide_mer_status != 1" <navigator v-if="hide_mer_status != 1"
:url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`" :url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`" class="link"
class="link" hover-class="none">进店</navigator> hover-class="none">进店</navigator>
</view> </view>
<view class="score-wrapper"> <view class="score-wrapper">
<view class="item"> <view class="item">
@ -290,20 +283,17 @@
<view class="acea-row row-between"> <view class="acea-row row-between">
<view class="title">店铺推荐</view> <view class="title">店铺推荐</view>
<navigator v-if="hide_mer_status!=1" class="moer-btn" <navigator v-if="hide_mer_status!=1" class="moer-btn"
:url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`" :url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`" hover-class="none">
hover-class="none">
查看更多<text class='iconfont icon-jiantou'></text></navigator> 查看更多<text class='iconfont icon-jiantou'></text></navigator>
</view> </view>
<view class="swiper page_swiper"> <view class="swiper page_swiper">
<swiper indicator-dots="true" :autoplay="false" :circular="circular" <swiper indicator-dots="true" :autoplay="false" :circular="circular" :interval="interval"
:interval="interval" :duration="duration" :current="swiperCur" style="750rpx;"> :duration="duration" :current="swiperCur" style="750rpx;">
<block v-for="(item,index) in recommend" :key="index"> <block v-for="(item,index) in recommend" :key="index">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<view class="img-box"> <view class="img-box">
<view class="img-item" v-for="(itm,idx) in item" :key="idx" <view class="img-item" v-for="(itm,idx) in item" :key="idx" @click="goProDetail(itm)">
@click="goProDetail(itm)"> <easy-loadimage mode="widthFix" :image-src="itm.image"></easy-loadimage>
<easy-loadimage mode="widthFix"
:image-src="itm.image"></easy-loadimage>
<view class="txt"> <view class="txt">
<view class="title line1">{{itm.store_name}}</view> <view class="title line1">{{itm.store_name}}</view>
<view class="price"> <view class="price">
@ -319,12 +309,10 @@
</view> </view>
</view> </view>
<view class='product-intro' id="past3" style="background-color: #fff;"> <view class='product-intro' id="past3" style="background-color: #fff;">
<view class='conter' v-if="description"> <view class='conter' v-if="description">
<!-- #ifndef APP-PLUS --> <!-- #ifndef APP-PLUS -->
<jyf-parser v-if="description.type == 0" :domain='domain' <jyf-parser v-if="description.type == 0" :domain='domain'
:html="description.content.replace(/<br\/>/ig, '')" ref="article" :html="description.content.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
:tag-style="tagStyle"></jyf-parser>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<view v-if="description.type == 0" class="description" <view v-if="description.type == 0" class="description"
@ -332,30 +320,10 @@
<!-- #endif --> <!-- #endif -->
<view v-else class="product_content"> <view v-else class="product_content">
<view v-if="description.content && description.content.title" class="title"> <view v-if="description.content && description.content.title" class="title">
{{description.content.title}} {{description.content.title}}</view>
</view>
<view v-if="description.content && description.content.image" class="pictures"> <view v-if="description.content && description.content.image" class="pictures">
<view class="" v-for="(item,index) in description.content.image" :key="index"> <image mode="widthFix" style="width: 100%;" v-for="(item,index) in description.content.image"
<view style="position: relative;" v-if='videoTypeList.includes(getSuffix(item))' :key="index" :src="item"></image>
@click="navGoPlay(item)">
<!-- #ifdef APP-PLUS -->
<image :src="item+coverUrl" mode="widthFix"
style="background-color: #fff;width: 100vw;" />
<!-- <image class="image-play-icon" src="/static/images/stop.png"> -->
<u--image class="image-play-icon" src="/static/images/stop.png"
width="100rpx" height="100rpx"></u--image>
</image>
<!-- #endif -->
<!-- #ifndef APP-PLUS -->
<video :src="item" objectFit="cover" controls style="width:750rpx;"
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate
:enable-progress-gesture="false"></video>
<!-- #endif -->
</view>
<image v-else :src="item" mode="widthFix"
style="background-color: #fff;width: 100vw;">
</image>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -376,8 +344,7 @@
</view> </view>
<view class='footer acea-row row-between-wrapper' :class="{'footpl':hide_mer_status==1}"> <view class='footer acea-row row-between-wrapper' :class="{'footpl':hide_mer_status==1}">
<navigator v-if="hide_mer_status !=1" <navigator v-if="hide_mer_status !=1"
:url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`" :url="`/pages/store/home/index?id=${storeInfo.mer_id}&sale_type=${sale_type||1}`" class='item skeleton-rect'>
class='item skeleton-rect'>
<view class='iconfont icon-dianpu'></view> <view class='iconfont icon-dianpu'></view>
<view>店铺</view> <view>店铺</view>
</navigator> </navigator>
@ -392,8 +359,8 @@
</view> </view>
</block> </block>
<navigator open-type='switchTab' class="animated item skeleton-rect" <navigator open-type='switchTab' class="animated item skeleton-rect" :class="animated==true?'bounceIn':''"
:class="animated==true?'bounceIn':''" url='/pages/order_addcart/order_addcart' hover-class="none"> url='/pages/order_addcart/order_addcart' hover-class="none">
<view class='iconfont icon-gouwuche1'> <view class='iconfont icon-gouwuche1'>
<text v-if="CartCount>0" class='num'>{{CartCount || 0}}</text> <text v-if="CartCount>0" class='num'>{{CartCount || 0}}</text>
</view> </view>
@ -401,8 +368,8 @@
</navigator> </navigator>
<view v-if="attr.productSelect.stock != 0" class='bnt acea-row skeleton-rect'> <view v-if="attr.productSelect.stock != 0" class='bnt acea-row skeleton-rect'>
<form @submit="joinCart" report-submit='true'> <form @submit="joinCart" report-submit='true'>
<button v-if="storeInfo.type != 1&&storeInfo.type != 2&&!storeInfo.mer_form_id" <button v-if="storeInfo.type != 1&&storeInfo.type != 2&&!storeInfo.mer_form_id" class='joinCart bnts'
class='joinCart bnts' form-type="submit">加入购物车</button> form-type="submit">加入购物车</button>
</form> </form>
<form @submit="goBuy" report-submit='true' v-if="attr.productSelect"> <form @submit="goBuy" report-submit='true' v-if="attr.productSelect">
<button class='buy bnts' <button class='buy bnts'
@ -435,8 +402,8 @@
<!-- 分享按钮 --> <!-- 分享按钮 -->
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''"> <view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<!-- #ifndef MP --> <!-- #ifndef MP -->
<button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' <button class="item" :class="weixinStatus ? 'item3' : ''" hover-class='none' v-if="weixinStatus === true"
v-if="weixinStatus === true" @click="H5ShareBox = true"> @click="H5ShareBox = true">
<view class="iconfont icon-weixin3"></view> <view class="iconfont icon-weixin3"></view>
<view class="">发送给朋友</view> <view class="">发送给朋友</view>
</button> </button>
@ -506,9 +473,7 @@
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
var sysHeight = uni.getSystemInfoSync().statusBarHeight; var sysHeight = uni.getSystemInfoSync().statusBarHeight;
import { import { arrivalSubscribe } from '@/utils/SubscribeMessage.js';
arrivalSubscribe
} from '@/utils/SubscribeMessage.js';
import { import {
getProductDetail, getProductDetail,
getProductParmas, getProductParmas,
@ -521,29 +486,13 @@
getDiscountsLst, getDiscountsLst,
priceRuleApi priceRuleApi
} from '@/api/store.js'; } from '@/api/store.js';
import { import { getOrderConfirm } from '@/api/order.js';
getOrderConfirm import { getUserInfo, imgToBase } from '@/api/user.js';
} from '@/api/order.js'; import { getCoupons, getShopCoupons } from '@/api/api.js';
import { import { getCartCounts } from '@/api/order.js';
getUserInfo, import { mapGetters } from "vuex";
imgToBase import { configMap } from "@/utils";
} from '@/api/user.js'; import { imageBase64 } from "@/api/public";
import {
getCoupons,
getShopCoupons
} from '@/api/api.js';
import {
getCartCounts
} from '@/api/order.js';
import {
mapGetters
} from "vuex";
import {
configMap
} from "@/utils";
import {
imageBase64
} from "@/api/public";
import productConSwiper from '@/components/productConSwiper'; import productConSwiper from '@/components/productConSwiper';
import couponListWindow from '@/components/couponListWindow'; import couponListWindow from '@/components/couponListWindow';
import copyPassword from '@/components/copyPassword'; import copyPassword from '@/components/copyPassword';
@ -551,19 +500,13 @@
import userEvaluation from '@/components/userEvaluation'; import userEvaluation from '@/components/userEvaluation';
import shareRedPackets from '@/components/shareRedPackets'; import shareRedPackets from '@/components/shareRedPackets';
import specs from '@/components/specs/index.vue'; import specs from '@/components/specs/index.vue';
import { import { toLogin } from '@/libs/login.js';
toLogin
} from '@/libs/login.js';
// #ifndef H5 // #ifndef H5
import passwordPopup from '@/components/passwordPopup'; import passwordPopup from '@/components/passwordPopup';
// #endif // #endif
import { import { HTTP_REQUEST_URL } from '@/config/app';
HTTP_REQUEST_URL
} from '@/config/app';
import home from '@/components/home'; import home from '@/components/home';
import { import { silenceBindingSpread } from "@/utils";
silenceBindingSpread
} from "@/utils";
import parser from "@/components/jyf-parser/jyf-parser"; import parser from "@/components/jyf-parser/jyf-parser";
import history from "@/mixins/history"; import history from "@/mixins/history";
import shareScence from "@/libs/spread"; import shareScence from "@/libs/spread";
@ -594,8 +537,6 @@
data() { data() {
let that = this; let that = this;
return { return {
videoTypeList: ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'flv', 'mpeg', '3gp', 'webm'],
coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
isNodes: 0, //, isNodes: 0, //,
sysHeight: sysHeight, // sysHeight: sysHeight, //
// //
@ -736,7 +677,6 @@
}, },
}, },
onLoad(options) { onLoad(options) {
console.log(options)
let that = this let that = this
if (options.spid) { if (options.spid) {
app.globalData.spid = options.spid; app.globalData.spid = options.spid;
@ -849,22 +789,6 @@
}, },
// #endif // #endif
methods: { methods: {
navGoPlay(url) {
uni.navigateTo({
url: `/pages/goods_details/videoPlay?url=${url}`
})
},
getSuffix(url) {
const str = url;
const lastIndex = str.lastIndexOf(".");
if (lastIndex !== -1) {
const extension = str.substring(lastIndex + 1);
return extension
} else {
console.log("字符串中没有找到点号。");
}
},
call: function() { call: function() {
let that = this; let that = this;
if (that.storeInfo.merchant.service_phone) { if (that.storeInfo.merchant.service_phone) {
@ -925,11 +849,7 @@
typeValue = 1 typeValue = 1
} }
// #endif // #endif
arrivalNoticeApi({ arrivalNoticeApi({ unique: uniqueValue, type: typeValue, product_id: that.id }).then(res => {
unique: uniqueValue,
type: typeValue,
product_id: that.id
}).then(res => {
return that.$util.Tips({ return that.$util.Tips({
title: res.message title: res.message
}) })
@ -992,15 +912,12 @@
}, },
/*获取套餐列表数据*/ /*获取套餐列表数据*/
getDiscountsData() { getDiscountsData() {
getDiscountsLst({ getDiscountsLst({ product_id: this.id }).then(res => {
product_id: this.id
}).then(res => {
this.comboTotal = res.data.count; this.comboTotal = res.data.count;
res.data.list.forEach((item, index) => { res.data.list.forEach((item, index) => {
item.save_price = 0; item.save_price = 0;
item.discountsProduct.forEach((v, i) => { item.discountsProduct.forEach((v, i) => {
item.save_price += parseFloat(v.product.ot_price) - parseFloat(v item.save_price += parseFloat(v.product.ot_price) - parseFloat(v.product.price)
.product.price)
}) })
}) })
this.comboList = res.data.list; this.comboList = res.data.list;
@ -1073,8 +990,7 @@
this.$set(this, 'toView', id); this.$set(this, 'toView', id);
this.$set(this, 'navActive', index); this.$set(this, 'navActive', index);
this.$set(this, 'lock', true); this.$set(this, 'lock', true);
this.$set(this, 'scrollTop', index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that this.$set(this, 'scrollTop', index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that.topArr[
.topArr[
index]); index]);
}, },
scroll: function(e) { scroll: function(e) {
@ -1121,8 +1037,7 @@
this.$set(this.attr.productSelect, "cart_num", stock); this.$set(this.attr.productSelect, "cart_num", stock);
this.$set(this, "cart_num", stock); this.$set(this, "cart_num", stock);
} }
if (num.cart_num > this.storeInfo.once_max_count && this.storeInfo.once_max_count != 0 && this if (num.cart_num > this.storeInfo.once_max_count && this.storeInfo.once_max_count != 0 && this.storeInfo
.storeInfo
.pay_limit != 0) { .pay_limit != 0) {
this.$set(this.attr.productSelect, "cart_num", this.storeInfo.once_max_count); this.$set(this.attr.productSelect, "cart_num", this.storeInfo.once_max_count);
this.$set(this, "cart_num", this.storeInfo.once_max_count); this.$set(this, "cart_num", this.storeInfo.once_max_count);
@ -1157,8 +1072,7 @@
let productSelect = this.productValue[res]; let productSelect = this.productValue[res];
if (productSelect) this.$set(this, "uniqueValue", productSelect.unique); if (productSelect) this.$set(this, "uniqueValue", productSelect.unique);
if (productSelect && productSelect.stock > 0) { if (productSelect && productSelect.stock > 0) {
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this.storeInfo
.storeInfo
.image); .image);
this.$set(this.attr.productSelect, "price", productSelect.price); this.$set(this.attr.productSelect, "price", productSelect.price);
this.$set(this.attr.productSelect, "svip_price", productSelect.svip_price); this.$set(this.attr.productSelect, "svip_price", productSelect.svip_price);
@ -1239,8 +1153,7 @@
that.$set(that, 'pay_limit', res.data.pay_limit); that.$set(that, 'pay_limit', res.data.pay_limit);
that.$set(that, 'min_count', res.data.once_min_count); that.$set(that, 'min_count', res.data.once_min_count);
that.$set(that, 'svipData', res.data.show_svip_info || null); that.$set(that, 'svipData', res.data.show_svip_info || null);
that.$set(that, 'svipPrice', res.data.show_svip_info && res.data.show_svip_info that.$set(that, 'svipPrice', res.data.show_svip_info && res.data.show_svip_info.show_svip_price ||
.show_svip_price ||
false); false);
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: storeInfo.store_name.substring(0, 7) + "..." title: storeInfo.store_name.substring(0, 7) + "..."
@ -1346,8 +1259,7 @@
"store_name", "store_name",
this.storeInfo.store_name this.storeInfo.store_name
); );
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this.storeInfo
.storeInfo
.image); .image);
this.$set(this.attr.productSelect, "price", productSelect.price); this.$set(this.attr.productSelect, "price", productSelect.price);
this.$set(this.attr.productSelect, "svip_price", productSelect.svip_price); this.$set(this.attr.productSelect, "svip_price", productSelect.svip_price);
@ -1562,8 +1474,7 @@
is_new: news === undefined ? 0 : 1, is_new: news === undefined ? 0 : 1,
product_id: that.id, product_id: that.id,
cart_num: that.attr.productSelect.cart_num, cart_num: that.attr.productSelect.cart_num,
product_attr_unique: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : product_attr_unique: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : "",
"",
source: this.source, source: this.source,
product_type: 0, product_type: 0,
spread_id: this.currSpid, spread_id: this.currSpid,
@ -1714,8 +1625,7 @@
]; ];
// #endif // #endif
//广 //广
that.$util.goodsPosterCanvas(arr2, that.storeInfo.store_name, that.storeInfo.price, that.site_name, that.$util.goodsPosterCanvas(arr2, that.storeInfo.store_name, that.storeInfo.price, that.site_name, that
that
.storeInfo.ot_price, .storeInfo.ot_price,
function(tempFilePath) { function(tempFilePath) {
that.$set(that, 'posterImage', tempFilePath); that.$set(that, 'posterImage', tempFilePath);
@ -2723,11 +2633,4 @@
color: #000000; color: #000000;
// border: 1px solid #F55726; // border: 1px solid #F55726;
} }
.image-play-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style> </style>

View File

@ -1,45 +0,0 @@
<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>

View File

@ -18,13 +18,6 @@
我是农民用户 我是农民用户
</view> </view>
</view> </view>
<view class="li" style="margin-top: 50rpx;" @click="navSw('/pages/index/index',true)">
<u-image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/static/merchant.webp" width="690rpx"
height="200rpx" style="position: absolute;"></u-image>
<view class="btn">
我是商户
</view>
</view>
</view> </view>
</template> </template>
@ -44,9 +37,7 @@
url url
}) })
}, },
navSw(url, isNewStore) { navSw(url) {
uni.setStorageSync('newStore', Boolean(isNewStore))
// return
uni.switchTab({ uni.switchTab({
url: url url: url
}) })

View File

@ -6,33 +6,27 @@
<view class="location"> <view class="location">
<view class="box flex_a_c_j_sb"> <view class="box flex_a_c_j_sb">
<view class="place_wrapper flex_a_c"> <view class="place_wrapper flex_a_c">
<view v-if="street&&street!='未开启定位'" @click="changeMap" class="iconfont icon-weizhi" <view v-if="street&&street!='未开启定位'" @click="changeMap" class="iconfont icon-weizhi" style="color:#fff;font-size:40rpx;"></view>
style="color:#fff;font-size:40rpx;"></view>
<view v-if="street&&street!='未开启定位'" @click="changeMap" class="town_name">{{street}}</view> <view v-if="street&&street!='未开启定位'" @click="changeMap" class="town_name">{{street}}</view>
</view> </view>
<view class="flex_a_c_j_sb"> <view class="flex_a_c_j_sb">
<view style="margin-right: 30rpx;" @click="scanQRcode" hover-class="none"> <view style="margin-right: 30rpx;" @click="scanQRcode" hover-class="none">
<view class="iconfont icon-saoma" style="color:#fff;font-size:40rpx;"> </view> <view class="iconfont icon-saoma" style="color:#fff;font-size:40rpx;"> </view>
</view> </view>
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none" <navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
style="position: relative;">
<view class="iconfont icon-xiaoxi" style="color:#fff;font-size:40rpx;"> </view> <view class="iconfont icon-xiaoxi" style="color:#fff;font-size:40rpx;"> </view>
<text class="iconnum" v-if="userInfo.user_unread">{{userInfo.user_unread}}</text>
</navigator> </navigator>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view :style="{ height: (swiperTop)+'px','background':'#40AE36','margin-bottom':'20rpx'}"></view>
<!--轮播图--> <!--轮播图-->
<view class="swiperBg"> <view class="swiperBg" :style="{ marginTop: (swiperTop + 13)+'px'}">
<view class="swiper page_swiper" v-if="imgUrls.length"> <view class="swiper page_swiper" v-if="imgUrls.length">
<swiper :autoplay="true" :circular="circular" :interval="intervals" :duration="duration" <swiper :autoplay="true" :circular="circular" :interval="intervals" :duration="duration"
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff" :current="swiperCur" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff" :current="swiperCur"
style="height:330rpx;margin: 0 auto;width:710rpx;" @change="swiperChange" style="height:330rpx;margin: 0 auto;width:710rpx;" @change="swiperChange" :class="{ scalex:isScale }">
:class="{ scalex:isScale }">
<block v-for="(item,index) in imgUrls" :key="index"> <block v-for="(item,index) in imgUrls" :key="index">
<swiper-item :class="{ active: index == swiperCur,scalex:isScale }"> <swiper-item :class="{ active: index == swiperCur,scalex:isScale }">
<view @click="goDetail(item)" class='slide-navigator acea-row row-between-wrapper'> <view @click="goDetail(item)" class='slide-navigator acea-row row-between-wrapper'>
@ -445,11 +439,11 @@
.iconnum { .iconnum {
min-width: 14rpx; min-width: 14rpx;
color: #fff; color: #E93323;
background: #E93323; background: #fff;
border-radius: 15rpx; border-radius: 15rpx;
position: absolute; position: absolute;
left: 20rpx; right: -10rpx;
top: -10rpx; top: -10rpx;
font-size: 10px; font-size: 10px;
padding: 0 5px; padding: 0 5px;

View File

@ -29,6 +29,11 @@
</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,27 +3,19 @@
<!-- #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}" <view class="navTabBox tabNav" :class="{isFixed:isFixed}" :style="'background:'+bgColor+';margin-top:'+mbConfig+'rpx;color:'+txtColor+';top:'+isTop">
: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-view scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="true">
: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="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" <navigator v-if="merId" :url="'/pages/store/home/index?id='+merId+'&type=2'" class="category" hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor">
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" <navigator v-else open-type='switchTab' url="/pages/goods_cate/goods_cate" class="category" hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor">
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>
@ -40,9 +32,7 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { import { getCateData } from '@/api/api.js';
getCateData
} from '@/api/api.js';
let app = getApp(); let app = getApp();
export default { export default {
name: 'navTab', name: 'navTab',
@ -182,13 +172,11 @@
.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;
@ -198,18 +186,15 @@
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;
@ -222,14 +207,12 @@
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%;
@ -237,19 +220,12 @@
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_wrap {
transition: height .4s;
overflow: hidden;
}
.category{ .category{
position: absolute; position: absolute;
right: 0; right: 0;
@ -267,14 +243,12 @@
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;
@ -284,7 +258,6 @@
/* #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;
@ -292,7 +265,6 @@
padding: 20rpx 0; padding: 20rpx 0;
background: #fff; background: #fff;
} }
.child-item{ .child-item{
flex-shrink: 0; flex-shrink: 0;
width:140rpx; width:140rpx;
@ -301,25 +273,21 @@
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{ &.on{
image{ image{
border: 1px solid $theme-color-opacity; border: 1px solid $theme-color-opacity;
} }
.txt{ .txt{
color: $theme-color; color: $theme-color;
} }

View File

@ -11,8 +11,8 @@
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<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"> @changeDiy="changeDiy"></homeComb>
</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,33 +39,12 @@
<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="hotLoading[hostIndex]" :hotTitle="hotTitle">
</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"
@ -103,14 +82,15 @@
<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"
:loading="hotLoading[hostIndex]" :hotTitle="hotTitle"> :loading="loading">
</recommend> </recommend>
<view class="loadingicon acea-row row-center-wrapper" <view class="loadingicon acea-row row-center-wrapper"
v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]"> v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]">
@ -120,12 +100,11 @@
</view> </view>
</view> </view>
</view> </view>
<view class="loadingicon acea-row row-center-wrapper" <view v-show="navIndex == 0" 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">
@ -281,7 +260,7 @@
<passwordPopup></passwordPopup> <passwordPopup></passwordPopup>
<!-- #endif --> <!-- #endif -->
<!--自定义底部tab栏--> <!--自定义底部tab栏-->
<!-- <customTab :newData="newData" :activeRouter="activeRouter"></customTab> --> <customTab :newData="newData" :activeRouter="activeRouter"></customTab>
<view v-if="overflow" class="overflow-mask" @touchmove.stop.prevent="() => {}"></view> <view v-if="overflow" class="overflow-mask" @touchmove.stop.prevent="() => {}"></view>
</view> </view>
</template> </template>
@ -298,8 +277,7 @@
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
let app = getApp(); let app = getApp();
import { import {
getUserInfo, getUserInfo
isNewMer
} from '@/api/user.js'; } from '@/api/user.js';
import { import {
getDiy, getDiy,
@ -452,8 +430,6 @@
}, },
data() { data() {
return { return {
subNvue: null,
diverFlag: true,
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
couponTypeMsg: { couponTypeMsg: {
10: '通用券', 10: '通用券',
@ -545,29 +521,27 @@
overflow: false, overflow: false,
diyId: 0, diyId: 0,
preview: false, preview: false,
isSupport: true, isSupport: true
isIndexClick: true,
scrollTop: 0,
tabScroll: 0
}; };
}, },
onTabItemTap(e) { onTabItemTap(e) {
if (this.isIndexClick) {
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
} else {
this.isIndexClick = true;
}
}, },
// //
onPageScroll(e) { onPageScroll(e) {
this.isIndexClick = true;
this.scrollTop = e.scrollTop;
this.isFixed = e.scrollTop > 40; this.isFixed = e.scrollTop > 40;
// uni.setTabBarItem({
// index: 0,
// text: "123",
// selectedIconPath: "/static/tabbar_icon/b-a.png"
// })
// this.$forceUpdate();
if (this.isHeaderSerch) { if (this.isHeaderSerch) {
let isScroll = false let isScroll = false
isScroll = e.scrollTop > 50 isScroll = e.scrollTop > 50
@ -577,20 +551,6 @@
} }
// scrollTopeasy-loadimage // scrollTopeasy-loadimage
uni.$emit('scroll'); uni.$emit('scroll');
if (e.scrollTop >= 100) {
uni.setTabBarItem({
index: 0,
text: "首页",
selectedIconPath: "/static/tabbar_icon/back_a.png"
})
} else {
uni.setTabBarItem({
index: 0,
text: "首页",
selectedIconPath: "/static/tabbar_icon/a-a.png"
})
}
}, },
/** /**
@ -620,11 +580,6 @@
}; };
}, },
// #endif // #endif
created(options) {
let routes = getCurrentPages(); //
let curRoute = routes[routes.length - 1].route //
this.activeRouter = '/' + curRoute
},
onLoad(options) { onLoad(options) {
let that = this let that = this
this._options = options; this._options = options;
@ -643,10 +598,13 @@
that.pageLoad(options); that.pageLoad(options);
this.$store.dispatch('INIT_CONFIG'); this.$store.dispatch('INIT_CONFIG');
}, },
created(options) {
let routes = getCurrentPages(); //
let curRoute = routes[routes.length - 1].route //
this.activeRouter = '/' + curRoute
},
onShow() { onShow() {
if (uni.getStorageSync('newStore')) this.openDiver(); let that = this
let that = this;
that.isIntegral = uni.getStorageSync('isIntegral') that.isIntegral = uni.getStorageSync('isIntegral')
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (that.appUpdate.openUpgrade == '1') { if (that.appUpdate.openUpgrade == '1') {
@ -662,8 +620,6 @@
that.isScrolled = res[0].top <= -60 that.isScrolled = res[0].top <= -60
}) })
}) })
this.isIndexClick = false;
if (this.isLogin) { if (this.isLogin) {
this.getUserInfo(); this.getUserInfo();
} }
@ -671,7 +627,9 @@
onHide() { onHide() {
uni.setStorageSync('isIntegral', false) uni.setStorageSync('isIntegral', false)
}, },
onReady() {
},
watch: { watch: {
globalDatas(nVal, oVal) { globalDatas(nVal, oVal) {
// #ifdef H5 // #ifdef H5
@ -680,62 +638,17 @@
}, },
}, },
onPullDownRefresh() { onPullDownRefresh() {
// this.overflow = true; this.overflow = true;
// this.reconnect(); this.reconnect();
// that.overflow = true;
// #ifdef APP-PLUS // #ifdef APP-PLUS
setTimeout(() => { setTimeout(() => {
this.hotPage = 1; uni.reLaunch({
this.hotScroll = true; url: "/pages/index/index"
let hostList = this.hostProduct; });
hostList[this.hostIndex] = [];
this.$set(this, 'hostProduct', hostList);
this.loadGoods(this.hostIndex + 1);
}, 50) }, 50)
// #endif // #endif
}, },
methods: { methods: {
/*新商户引导页相关*/
openDiver() {
// #ifdef APP
this.subNvue = uni.getSubNVueById('newUser')
this.subNvue.show('slide-in-left', 300)
uni.$on('offSubnvue', () => {
this.subNvue.hide('slide-out-left')
if (uni.getStorageSync("newStore")) {
uni.switchTab({
url: '/pages/user/index'
})
}
});
// uni.$on('diverIndexSubEmit', () => {
// this.subNvue.hide('slide-out-left')
// uni.switchTab({
// url: '/pages/gather/gather'
// })
// })
// #endif
},
/* 新商户发布商品引导页 */
openListGoodsDiver() {
if (Boolean(this.userInfo.service?.mer_id)) {
uni.$on('diverIndexSubEmit', () => {
this.subNvue.hide('slide-out-left')
uni.switchTab({
url: '/pages/gather/gather'
})
})
isNewMer(this.userInfo.uid, this.userInfo.service?.mer_id).then(
res => {
if (res.data == 'true') {
this.subNvue = uni.getSubNVueById('concatIndex')
this.subNvue.show('slide-in-left', 300)
}
})
}
},
loadCoupon() { loadCoupon() {
if (!this.showCoupon && !uni.getStorageSync('show_coupon') && uni.getStorageSync('is_new_user')) { if (!this.showCoupon && !uni.getStorageSync('show_coupon') && uni.getStorageSync('is_new_user')) {
getNewPeopleCouponLst().then(res => { getNewPeopleCouponLst().then(res => {
@ -795,7 +708,7 @@
}, },
bindHeighta(data) { bindHeighta(data) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
// this.sortMpTop = data.top + data.height; this.sortMpTop = data.top + data.height;
// #endif // #endif
}, },
// //
@ -1073,12 +986,8 @@
showTab(res.data); showTab(res.data);
that.userInfo = res.data; that.userInfo = res.data;
this.$store.commit('SET_USERINFO', res.data); this.$store.commit('SET_USERINFO', res.data);
// #ifdef APP
this.openListGoodsDiver()
// #endif
}); });
}, },
// 访 // 访
setVisit() { setVisit() {
setVisit({ setVisit({
@ -1112,14 +1021,14 @@
self.sortMarTop = 10; self.sortMarTop = 10;
} }
}, },
// //
get_product_list: function() { get_product_list: function() {
let that = this; let that = this;
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).then(res => { getProductslist(that.where)
.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;
@ -1128,15 +1037,16 @@
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 => { })
.catch(err => {
that.loading = false; that.loading = false;
that.loadTitle = '加载更多'; that.loadTitle = '加载更多';
}); });
}, },
/**
// * 点击组件选项卡
*/
changeRecommedTab(e) { changeRecommedTab(e) {
let that = this;
this.hotPage = 1; this.hotPage = 1;
this.hotScroll = true; this.hotScroll = true;
this.hostIndex = e - 1; this.hostIndex = e - 1;
@ -1144,15 +1054,8 @@
hostList[e - 1] = []; hostList[e - 1] = [];
this.$set(this, 'hostProduct', hostList); this.$set(this, 'hostProduct', hostList);
this.loadGoods(e); this.loadGoods(e);
uni.pageScrollTo({
scrollTop: that.$refs.recommendRef.tabsTop,
duration: 200
})
}, },
loadGoods(e = 1) { loadGoods(e = 1) {
this.$nextTick(() => {
if (e == 1) return this.get_host_product(0); if (e == 1) return this.get_host_product(0);
if (e == 2) return this.get_host_home({ if (e == 2) return this.get_host_home({
mer_type: 1 mer_type: 1
@ -1163,42 +1066,38 @@
if (e == 4) return this.get_host_home({ if (e == 4) return this.get_host_home({
mer_type: 3 mer_type: 3
}, 3); }, 3);
})
}, },
/**
// * 获取我的推荐
*/
get_host_product: function(e = 0) { get_host_product: function(e = 0) {
let that = this; let that = this;
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;
if (!productList[e]) productList[e] = []; if (!productList[e]) productList[e] = [];
productList[e] = [...productList[e], ...res.data.list]; productList[e] = [...productList[e], ...res.data.list];
let hotScroll = list.length <= res.data.limit && list.length != 0; let hotScroll = list.length <= res.data.limit && list.length != 0;
that.hotScroll = hotScroll; that.hotScroll = hotScroll;
that.hotLoading[e] = false; that.hotLoading[e] = false;
that.hotTitle = !hotScroll ? '已全部加载' : '加载更多'; that.hotTitle = !hotScroll ? '已全部加载' : '加载更多';
that.$set(that, 'hostProduct', productList); that.$set(that, 'hostProduct', productList);
if (this.hostIndex == e) this.$forceUpdate();
that.$set(that, 'hotPage', res.data.page + 1); that.$set(that, 'hotPage', res.data.page + 1);
that.$set(that, 'hotLimit', res.data.limit); that.$set(that, 'hotLimit', res.data.limit);
this.$forceUpdate();
}); });
}, },
/**
// , , * 获取里海云仓, 云市场, 名优特产
*/
get_host_home: function(query = {}, e = 1) { get_host_home: function(query = {}, e = 1) {
let that = this; let that = this;
let num = that.hotLimit; let num = that.hotLimit;
@ -1213,7 +1112,6 @@
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;
@ -1247,13 +1145,11 @@
this.$set(this, 'navTop', res.data); this.$set(this, 'navTop', res.data);
}); });
}, },
reloadData() { reloadData() {
setTimeout(() => { setTimeout(() => {
this.showSkeleton = false this.showSkeleton = false
}, 500) }, 500)
}, },
// //
goDetail(item) { goDetail(item) {
if (item.activity && item.activity.type === '2' && !this.isLogin) { if (item.activity && item.activity.type === '2' && !this.isLogin) {
@ -1297,7 +1193,6 @@
}); });
} }
}, },
//#ifdef H5 //#ifdef H5
ShareInfo(datas) { ShareInfo(datas) {
let data = this.storeInfo; let data = this.storeInfo;
@ -1333,7 +1228,6 @@
this.domHeight = res[0].height; this.domHeight = res[0].height;
}) })
}, },
// //
onReachBottom() { onReachBottom() {
if (this.recommend_switch == 1 && this.navIndex == 0) { if (this.recommend_switch == 1 && this.navIndex == 0) {
@ -1345,7 +1239,7 @@
this.get_product_list(); this.get_product_list();
} }
} }
} },
}; };
</script> </script>
<style> <style>

View File

@ -1,213 +0,0 @@
<template>
<view class="" style="width: 750rpx;height: 100%;">
<view class="jump" @click="jump">
<text class="font">跳过</text>
</view>
<view class="next-btn" :style="{top:(offsetY-250)+'px'}">
<text class="next-btn-text font" @click="next">下一步(1/4)</text>
</view>
<view class="tips-box" :style="{right:20, top:(offsetY-218)+'px'}">
<view class="tips" style="position: absolute;padding-left: 10rpx;">
<view class="tras" :class="{act:isActive}">
<text style="font-size: 28rpx;line-height: 100rpx;color: white;">点击工作台,进入办公助手</text>
</view>
</view>
<image src="/static/images/starpng.png" class="start" mode="">
</image>
</view>
<view style="position: absolute;" class="center" :style="{top:(offsetY-120)+'px'}">
<image src="/static/images/greenLine.png" style="width:35px;height: 60px;" mode=""></image>
</view>
<view class="tabbar2 center" :style="{top:(offsetY-68)+'px'}">
<image src="/static/images/ydwd.png" class="tab-icon"></image>
<text class="te">工作台</text>
</view>
<view class="pointe2" :style="{top:(offsetY-58)+'px'}">
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;" mode=""></image>
</view>
</view>
</template>
<script>
import {
isNewMer
} from '@/api/user.js';
export default {
data() {
return {
isActive: false,
subNVue: null,
screenWidth: 400,
offsetX: 0,
offsetY: 0,
isStore: false,
}
},
methods: {
next() {
uni.$emit('diverIndexSubEmit');
},
jump() {
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id, {
done: 1
}).then(res => {
console.log(res, 'res')
})
uni.$emit('diverIndexSubEmit');
}
},
onLoad() {
uni.$on('diverIndexEmit', (data) => {
this.isStore = Boolean(data.mer_info?.mer_name)
})
let that = this
this.subNVue = uni.getSubNVueById('concatIndex')
const res = uni.getSystemInfo({
success: (res => {
this.offsetY = res.screenHeight
this.screenWidth = res.screenWidth
})
});
setTimeout(() => {
that.isActive = true
}, 1000)
}
}
</script>
<style>
.jump {
position: absolute;
right: 30rpx;
top: 80rpx;
}
.tips-box {
width: 462rpx;
height: 178rpx;
position: absolute;
padding-top: 72rpx;
position: absolute;
}
.start {
width: 72rpx;
height: 72rpx;
position: absolute;
right: 0;
top: 20px;
}
.tips {
width: 462rpx;
height: 106rpx;
background-color: #5BE157;
border-radius: 20rpx;
}
.center {
position: absolute;
left: 375rpx;
transform: translateX(-50%);
}
.tabbar {
width: 136rpx;
height: 136rpx;
background-color: white;
border-radius: 136rpx;
position: absolute;
left: 375rpx;
transform: translateX(-50%);
/* bottom: 0; */
}
.tabbar2 {
width: 136rpx;
height: 136rpx;
background-color: white;
border-radius: 136rpx;
position: absolute;
}
.tab-icon {
width: 50rpx;
height: 50rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, -50%);
top: 68rpx;
}
.te {
font-size: 20rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, 0);
top: 100rpx;
}
.pointe {
position: absolute;
left: 420rpx;
transform: translateX(-50%);
}
.pointe2 {
position: absolute;
left: 420rpx;
transform: translateX(-50%);
/* left: 150rpx; */
}
.tras {
padding-left: 10rpx;
position: absolute;
z-index: 999 !important;
width: 0px;
transition-property: width;
transition-duration: 3s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.act {
width: 462rpx;
}
.font {
font-size: 28rpx;
color: white;
lines: 1;
}
.next-btn {
position: absolute;
/* bottom: 100rpx; */
left: 375rpx;
transform: translateX(-50%);
width: 240rpx;
height: 76rpx;
border: 1px solid white;
border-radius: 38rpx;
background-color: rgba(255, 255, 255, 0.4);
}
.next-btn-text {
line-height: 76rpx;
text-align: center;
/* background-color: #939393; */
}
.jump {
position: absolute;
right: 30rpx;
top: 80rpx;
border: 1px solid white;
padding: 10rpx 20rpx;
border-radius: 30rpx;
}
</style>

View File

@ -1,167 +0,0 @@
<template>
<view class="">
<view class="jump" @click="jump">
<text class="font">跳过</text>
</view>
<view class="next-btn center" :style="{ left:screenWidth/2,top:(screenHeight-96)}">
<text class="next-btn-text font" style="line-height: 76rpx;" @click="next">下一步(1/2)</text>
</view>
<view class="target" :style="{left:screenWidth/4*3,top:screenHeight-68}">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/96aba202405171618278261.png"
class="target-icon"></image>
<text class="target-text">我的</text>
</view>
<view :style="{left:screenWidth/4*3,top:screenHeight-130}">
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;"></image>
</view>
<view class="tips-box" :style="{right:20,top:screenHeight-220}">
<view class="tips" style="position: absolute;padding-left: 20px;">
<view class="tras" :class="{act:isAct}">
<text style="font-size: 28rpx;line-height: 100rpx;color: white;">点击我的页面,进行商户入驻</text>
</view>
</view>
<image src="/static/images/starpng.png" class="start" mode="">
</image>
</view>
<image src="/static/images/greenLine.png" class="greenLine"
:style="{left:screenWidth/4*3+15,top:screenHeight-120}" mode=""></image>
</view>
</template>
<script>
export default {
data() {
return {
screenHeight: 800,
screenWidth: 375,
isAct: false
}
},
methods: {
jump() {
uni.setStorageSync("newStore", false)
uni.$emit('offSubnvue');
},
next() {
uni.$emit('offSubnvue');
}
},
onLoad() {
let that = this
const res = uni.getSystemInfo({
success: (res => {
this.screenHeight = res.screenHeight
this.screenWidth = res.screenWidth
})
});
setTimeout(() => {
that.isAct = true
})
}
}
</script>
<style>
.jump {
position: absolute;
right: 30rpx;
top: 80rpx;
border: 1px solid white;
padding: 10rpx 20rpx;
border-radius: 30rpx;
}
.font {
font-size: 28rpx;
color: white;
lines: 1;
text-align: center;
}
.center {
transform: translateX(-50%);
}
.next-btn {
position: absolute;
width: 240rpx;
height: 76rpx;
border: 1px solid white;
border-radius: 38rpx;
background: rgba(255, 255, 255, 0.4);
}
.target {
width: 136rpx;
height: 136rpx;
background-color: white;
border-radius: 136rpx;
}
.target-icon {
width: 50rpx;
height: 50rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, -50%);
top: 68rpx;
}
.target-text {
font-size: 20rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, 0);
top: 100rpx;
}
.pointer {
position: absolute;
}
.tips-box {
width: 462rpx;
height: 178rpx;
position: absolute;
padding-top: 72rpx;
position: absolute;
}
.start {
width: 72rpx;
height: 72rpx;
position: absolute;
right: 0;
top: 20px;
}
.tips {
width: 462rpx;
height: 106rpx;
background-color: #5BE157;
border-radius: 20rpx;
}
.tras {
width: 0px;
transition-property: width;
transition-duration: 3s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.act {
width: 462rpx;
}
.greenLine {
width: 35px;
height: 60px;
position: absolute;
}
</style>

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 line1" style="max-width: 450rpx;">{{item.mer_name}}</view> <view class="name">{{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,11 +88,13 @@
</view> </view>
<view class='money acea-row row-middle'> <view class='money acea-row row-middle'>
<view class="line1" style="max-width: 260rpx;"> <view>
<text class="money-price">{{goods.productAttr.price}}</text> <text class="money-price">{{goods.productAttr.price}}</text>
<text <text class="money-unit">/</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'>
@ -178,8 +180,8 @@
@ChangCouponsUseState="ChangCouponsUseState"></couponListWindow> @ChangCouponsUseState="ChangCouponsUseState"></couponListWindow>
</block> </block>
<!-- 组件 --> <!-- 组件 -->
<addcartWindow :key="addcartKey" :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent" <addcartWindow :key="addcartKey" :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
@ChangeAttr="ChangeAttr" @goCat="goCat" @attrVal="attrVal" id='product-window'></addcartWindow> @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>

View File

@ -128,19 +128,17 @@
</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)">
<text class="merchant_name line1">{{orderInfo.merchant.mer_name}}</text> {{orderInfo.merchant.mer_name}}
<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" <orderGoods :orderData='orderInfo' :pay_type="orderInfo.pay_type" :status="orderInfo.status" :evaluate='orderInfo.status'
:evaluate='orderInfo.status' :activityType='orderInfo.activity_type' :sale_type="sale_type" :activityType='orderInfo.activity_type' :sale_type="sale_type" :orderId="order_id" :cartInfo="cartInfo" :jump="true">
: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" <orderGoods :orderData='item' :pay_type="orderInfo.pay_type" :status="orderInfo.status" :evaluate='item.status' :activityType='item.activity_type' :sale_type="sale_type"
: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>
@ -290,8 +288,7 @@
</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 class='conter' style="width: auto;color: #F55726;">-{{orderInfo.platform_coupon_price}}</view>
</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>
@ -945,8 +942,7 @@
}).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=' + url: '/pages/users/order_confirm/index?cartId=' + cart_id + '&sale_type=' + this.sale_type
this.sale_type
}); });
}).catch(err => { }).catch(err => {
that.$util.Tips({ that.$util.Tips({
@ -1058,7 +1054,6 @@
} }
.merchant { .merchant {
display: flex;
width: 100%; width: 100%;
height: 86rpx; height: 86rpx;
padding: 0 30rpx; padding: 0 30rpx;
@ -1070,12 +1065,6 @@
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 line1" @click="goStore(item)">{{item.merchant.mer_name}}<text <view class="title" @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

@ -138,10 +138,6 @@
this.mer_id = opt.mer_id; this.mer_id = opt.mer_id;
}, },
onReady() {
this.handleOpenKeyboard();
},
onShow() { onShow() {
if (!this.isLogin) { if (!this.isLogin) {
Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id); Cache.set("login_back_url_weixin", "/" + getCurrentPages()[0].route + "?mer_id=" + this.mer_id);

View File

@ -1,50 +1,7 @@
<template> <template>
<view style="padding: 42rpx 50rpx;"> <view>
<view class="card" v-for="item in listData" :key="item.mer_intention_id">
<view class="" style="display: flex;align-items: center;">
<view class="ciecle"
style="width: 24rpx;height: 24rpx;border-radius: 24rpx;border: 1px solid #DDDDDD;margin-right: 30rpx;">
</view>
<view class="" style="color: #777777;font-size: 24rpx;">
{{item.create_time}}
</view>
</view>
<view class=""
style="padding:40rpx;margin: 30rpx 0; width: 606rpx;margin-left: 30rpx;border-radius: 16rpx;box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0,0,0,0.16);">
<view class="" v-if="item.status==0" style="color: #20B128;font-size: 32rpx;">
待审核
</view>
<view class="" v-if="item.status==1" style="color: #20B128;font-size: 32rpx;">
审核通过
</view>
<view class="" v-if="item.status==2"
style="color: #FC452F;font-size: 32rpx;display: flex;justify-content: space-between;">
审核失败
<view style="color: #20B128;" @click="navgo">
重新申请
</view>
</view>
<u-line style="margin: 28rpx 0;"></u-line>
<view class="" style="margin-bottom: 20rpx;">
{{item.mer_name}}
</view>
<view class="" v-if="item.status==1" style="font-size: 24rpx; color: #777777;">
可以登录我们的工作台把您的商品推向市场了
</view>
<view class="" v-if='item.status==2' style="font-size: 24rpx; color: #777777;">
备注:{{item.fail_msg}}
</view>
</view>
</view>
<u-button v-if="showBtn" @click="openApplet" color="#3ABD40" shape="circle" text="立即发布产品"></u-button>
<view class="application-record" v-if="listData.length"> <view class="application-record" v-if="listData.length">
<!-- <view class="card-list" v-for="item in listData" :key="item.mer_intention_id"> <view class="card-list" v-for="item in listData" :key="item.mer_intention_id">
<view class="card-top"> <view class="card-top">
<view class="title">{{item.mer_name}}</view> <view class="title">{{item.mer_name}}</view>
<view class="time">提交时间{{item.create_time}}</view> <view class="time">提交时间{{item.create_time}}</view>
@ -60,7 +17,7 @@
</view> </view>
<view class="status-btn" @click="jump(item)">{{statusBtn(item.status)}}</view> <view class="status-btn" @click="jump(item)">{{statusBtn(item.status)}}</view>
</view> </view>
</view> --> </view>
</view> </view>
<view class='no-shop' v-if="!listData.length && !loading"> <view class='no-shop' v-if="!listData.length && !loading">
<view class='pictrue' style="margin: 0 auto;"> <view class='pictrue' style="margin: 0 auto;">
@ -82,22 +39,15 @@
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { import {
getApplicationRecordList, getApplicationRecordList
getUnimpInfo
} from '@/api/store.js' } from '@/api/store.js'
import { import {HTTP_REQUEST_URL} from '@/config/app';
HTTP_REQUEST_URL
} from '@/config/app';
import uniMP from '@/utils/uniMP.js';
export default { export default {
data() { data() {
return { return {
domain:HTTP_REQUEST_URL, domain:HTTP_REQUEST_URL,
loading: false, loading: false,
showBtn: false,
listData: [], listData: [],
uniMpInfo: {},
pageData: { pageData: {
page: 1, page: 1,
limit: 10, limit: 10,
@ -121,10 +71,6 @@
} }
}, },
methods: { methods: {
openApplet() {
this.uniMpInfo.showToast = true
uniMP.loadAppletMP(this.uniMpInfo)
},
getListData() { getListData() {
this.loading = true this.loading = true
uni.showLoading({ uni.showLoading({
@ -133,23 +79,8 @@
getApplicationRecordList(this.pageData).then(res => { getApplicationRecordList(this.pageData).then(res => {
this.count = res.data.count this.count = res.data.count
this.listData = this.listData.concat(res.data.list) this.listData = this.listData.concat(res.data.list)
this.showBtn = (this.listData[this.listData.length - 1].status == 1)
if (this.showBtn) {
getUnimpInfo().then(res => {
this.uniMpInfo = res.data
})
}
uni.hideLoading(); uni.hideLoading();
this.loading = false this.loading = false
}).catch(() => {
uni.hideLoading();
this.loading = false
})
},
navgo() {
// uni.navigateBack()
uni.navigateTo({
url: '/pages/store/settled/index?type=1'
}) })
}, },
// //
@ -196,20 +127,72 @@
align-items: center; align-items: center;
background-color: #F5F5F5; background-color: #F5F5F5;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
.card-list {
width: 100%;
background-color: #fff;
padding: 20rpx 24rpx;
margin: 10rpx 20rpx;
border-radius: 12rpx;
.card-top {
height: 140rpx;
.title {
font-size: 28rpx;
font-weight: bold;
color: #333333;
}
.time {
color: #999999;
font-size: 24rpx;
padding: 5rpx 0;
}
.reason {
color: #E93323;
font-weight: bold;
font-size: 24rpx;
}
}
.line {
height: 2rpx;
margin: 20rpx 0 20rpx 0;
background-color: #EEEEEE;
}
.card-bottom {
display: flex;
justify-content: space-between;
align-items: center;
color: #333;
.card-status {
display: flex;
align-items: center;
.status-icon {
width: 30rpx;
height: 30rpx;
margin: 10rpx;
}
.status-text {
font-size: 28rpx;
font-weight: 500;
}
}
.status-btn {
font-size: 26rpx;
color: #555;
border: 1px solid #999999;
padding: 8rpx 32rpx;
border-radius: 40rpx;
}
}
}
} }
.no-shop { .no-shop {
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
height: 100vh; height: 100vh;
.pictrue { .pictrue {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
color: $uni-nothing-text; color: $uni-nothing-text;
image { image {
width: 414rpx; width: 414rpx;
height: 380rpx; height: 380rpx;

View File

@ -1,7 +1,58 @@
<style lang="scss">
.tab-cont {
display: flex;
.aside-left-placeholder {
width: 152rpx;
}
.aside-left {
position: fixed;
left: 0;
z-index: 2;
display: flex;
flex-wrap: wrap;
width: 152rpx;
overflow-y: auto;
background-color: #F4F4F4;
.aside-left-item {
width: 100%;
height: 94rpx;
line-height: 94rpx;
text-align: center;
padding: 0 14rpx;
}
.aside-active {
position: relative;
font-weight: bold;
font-size: 26rpx;
color: #40AE36;
background-color: #fff;
&::before {
content: "";
display: inline-block;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 6rpx;
height: 36rpx;
background: #40AE36;
border-radius: 0rpx 4rpx 4rpx 0rpx;
}
}
}
}
</style>
<template> <template>
<view class="store-home"> <view class="store-home">
<view class="header"> <view class="header">
<view style="height: var(--status-bar-height);"></view> <view style="height: var(--status-bar-height);"></view>
<view class="head-menu"> <view class="head-menu">
<view class="iconfont icon-xiangzuo" @click="goback" style="color: #fff;"></view> <view class="iconfont icon-xiangzuo" @click="goback" style="color: #fff;"></view>
<navigator :url="'/pages/store/list/index?mer_id='+id" hover-class="none" <navigator :url="'/pages/store/list/index?mer_id='+id" hover-class="none"
@ -13,6 +64,15 @@
</view> </view>
<view class="shop"> <view class="shop">
<!-- <view class="shop-img">
<u-image width="100rpx" height="154rpx" :lazyLoad="true" :fade="true" :src="store.mer_avatar"
radius="10">
<template v-slot:loading>
<u-loading-icon color="#999"></u-loading-icon>
</template>
</u-image>
</view> -->
<view class="shop-info"> <view class="shop-info">
<view class="shop-info-title" @click="navTo('/pages/store/detail/index?id='+id)"> <view class="shop-info-title" @click="navTo('/pages/store/detail/index?id='+id)">
<text>{{store.mer_name}}</text> <text>{{store.mer_name}}</text>
@ -27,8 +87,7 @@
</view> </view>
<view class="shop-info-sale">月销{{store.sales}}+</view> <view class="shop-info-sale">月销{{store.sales}}+</view>
<view v-if="store.services_type == 0" class="iconfont icon-kefu3" @click="goService"></view> <view v-if="store.services_type == 0" class="iconfont icon-kefu3" @click="goService"></view>
<view v-else-if="store.services_type == 1" class="iconfont icon-kefu3" @click="call(1)"> <view v-else-if="store.services_type == 1" class="iconfont icon-kefu3" @click="call(1)"></view>
</view>
<view v-else class="iconfont icon-kefu3" @click="call(0)"> </view> <view v-else class="iconfont icon-kefu3" @click="call(0)"> </view>
</view> </view>
<view class="shop-info-runtime" v-if="store.mer_info&&store.mer_info.mer_take_time">营业时间 : <view class="shop-info-runtime" v-if="store.mer_info&&store.mer_info.mer_take_time">营业时间 :
@ -52,6 +111,7 @@
</view> </view>
</view> </view>
<scroll-view class="main" scroll-y="true" @scroll="scrollHome" catchtouchmove :style="viewColor">
<view v-show="!navShow && (tabActive === 3 || tabActive === 7)" class="nav"> <view v-show="!navShow && (tabActive === 3 || tabActive === 7)" class="nav">
<view class="nav-cont" :class="{noPointer : preview}" id="nav-cont"> <view class="nav-cont" :class="{noPointer : preview}" id="nav-cont">
<view :class="{ active: navActive === 0 }" class="item" @click="set_where(0,0)"> <view :class="{ active: navActive === 0 }" class="item" @click="set_where(0,0)">
@ -84,19 +144,17 @@
</block> </block>
</view> </view>
<scroll-view class="main" scroll-y="true" @scroll="scrollHome" catchtouchmove :style="viewColor">
<view class="tab-cont" <view class="tab-cont"
:style="viewColor,{'height':'calc(100vh - '+(listHeight) + (tabActive == 2?' + 84rpx':'')+' )'}" :style="viewColor,{'height':'calc(100vh - '+listHeight+' - 84rpx '+(tabActive == 2?' + 84rpx':'')+' )'}"
:class="{noPointer : preview}"> :class="{noPointer : preview}">
<!-- 占位 --> <!-- 占位 -->
<view class="aside-left-placeholder" v-if="tabActive != 2"></view> <view class="aside-left-placeholder" v-if="tabActive != 2"></view>
<!-- 大分类 --> <!-- 大分类 -->
<view class="aside-left" v-if="tabActive != 2" <view class="aside-left" v-if="tabActive != 2"
:style="{'top':'calc('+headHeight+')','height':'calc(100vh - '+listHeight+')'}"> :style="{'top':'calc('+headHeight+')','height':'calc(100vh - '+listHeight+' - 84rpx)'}">
<block v-for="(item,index) in asideMenu" :key="index"> <block v-for="item in asideMenu" :key="item.store_category_id">
<view class="aside-left-item line1" @click="onChangeAsideMenu(item.store_category_id)" <view class="aside-left-item line1" @click="onChangeAsideMenu(item.store_category_id)"
:class="{'aside-active':asideCurr == item.store_category_id?true:false}"> :class="{'aside-active':asideCurr == item.store_category_id?true:false}">
{{item.cate_name}} {{item.cate_name}}
@ -150,30 +208,14 @@
</view> </view>
<!-- 首页 --> <!-- 首页 -->
<view style="margin:0px auto;" <view style="margin:0 auto;"
v-show="(tabActive == 3 || tabActive == 7 || diyActive == 1 || diyActive == 2) && tabActive != 5 && tabActive != 2"> v-show="(tabActive == 3 || tabActive == 7 || diyActive == 1 || diyActive == 2) && tabActive != 5 && tabActive != 2">
<!-- 二级分类 -->
<scroll-view :scroll-x="true" class="small-classify" :style="{'width':'calc(100vw - 152rpx)'}"
v-if="asideCurr">
<view class="second-item-con-wrap">
<view class="second-item-con" :style="{'flex-wrap':isChangeSecTabStyle?'wrap':''}">
<block v-for="item in secondTabList" :key="item.store_category_id">
<view class="small-classify-item"
:class="{'small-classify-item-active':secondTabCurr == item.store_category_id?true:false}"
@click="onSecondTabChange(item.store_category_id)">
{{item.cate_name}}
</view>
</block>
</view>
<view class="sanjiaoxing" @click="onChangeSecTabStyle"></view>
</view>
</scroll-view>
<!-- 商品 --> <!-- 商品 -->
<view v-if="goods.length" class="goods-wrap" id="goods" @touchmove="onTouchmove" <view v-if="goods.length" class="goods-wrap" id="goods" @touchmove="onTouchmove"
:style="{'width':'calc(100vw - 152rpx)','padding-top':(!!asideCurr?'94rpx' :'')}"> :style="{'width':'calc(100vw - 152rpx)'}">
<view v-if="isColumn" class="goods column"> <view v-if="isColumn" class="goods column">
<view v-for="(item,indx) in goods" :key="indx" class="item" @click="goGoodsDetail(item)"> <view v-for="item in goods" :key="item.product_id" class="item"
@click="goGoodsDetail(item)">
<view class="image" style="width: 180rpx;height: 180rpx;"> <view class="image" style="width: 180rpx;height: 180rpx;">
<image style="width: 100%;height: 100%;" :src="item.image" lazy-load></image> <image style="width: 100%;height: 100%;" :src="item.image" lazy-load></image>
<view v-if="item.stock == 0" class="sell_out">已售罄</view> <view v-if="item.stock == 0" class="sell_out">已售罄</view>
@ -189,9 +231,7 @@
<!-- 标签 --> <!-- 标签 -->
<view class="tag" v-if="item.mer_label_name && item.mer_label_name.length > 0"> <view class="tag" v-if="item.mer_label_name && item.mer_label_name.length > 0">
<view class="tag-item" v-for="(ii,indx) in item.mer_label_name" :key="indx"> <view class="tag-item" v-for="(ii,indx) in item.mer_label_name">{{ii}}</view>
{{ii}}
</view>
</view> </view>
<!-- 规格产地 --> <!-- 规格产地 -->
@ -213,8 +253,7 @@
<WaterfallsFlow :wfList='goods' @itemTap="goGoodsDetail" :type="1" :isStore="1" /> <WaterfallsFlow :wfList='goods' @itemTap="goGoodsDetail" :type="1" :isStore="1" />
</view> </view>
</view> </view>
<view v-if="goodsLoading" class="acea-row row-center-wrapper loadingicon" <view v-if="goodsLoading" class="acea-row row-center-wrapper loadingicon">
:style="{'margin-top':!!asideCurr?'94rpx':''}">
<text :hidden="!goodsLoading" class="iconfont icon-jiazai loading"></text> <text :hidden="!goodsLoading" class="iconfont icon-jiazai loading"></text>
{{loadTitle}} {{loadTitle}}
</view> </view>
@ -230,19 +269,18 @@
<view class="iconfont icon-xiangyou"></view> <view class="iconfont icon-xiangyou"></view>
</view> </view>
</view> </view>
<view v-for="(item,indx) in category" :key="indx" class="section"> <view v-for="item in category" :key="item.store_category_id" class="section">
<view class="head" @click="goCategoryGoods(item.store_category_id)"> <view class="head" @click="goCategoryGoods(item.store_category_id)">
<view class="title">{{ item.cate_name }}</view> <view class="title">{{ item.cate_name }}</view>
<view class="iconfont icon-xiangyou"></view> <view class="iconfont icon-xiangyou"></view>
</view> </view>
<view v-if="item.children" class="body"> <view v-if="item.children" class="body">
<view v-for="(value,indx) in item.children" :key="indx" class="item" <view v-for="value in item.children" :key="value.store_category_id" class="item"
@click="goCategoryGoods(value.store_category_id)">{{ value.cate_name }}</view> @click="goCategoryGoods(value.store_category_id)">{{ value.cate_name }}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="acea-row row-center-wrapper loadingicon" <view class="acea-row row-center-wrapper loadingicon">
:style="{'margin-top':!!asideCurr?'94rpx':''}">
<text :hidden="!categoryLoading" class="iconfont icon-jiazai loading"></text> <text :hidden="!categoryLoading" class="iconfont icon-jiazai loading"></text>
{{loadTitle}} {{loadTitle}}
</view> </view>
@ -391,7 +429,7 @@
navShow: false, navShow: false,
navActive: 0, navActive: 0,
diyActive: 0, diyActive: 0,
tabActive: 3, // tabActive: '', //
isCoupon: 0, isCoupon: 0,
keyword: '', keyword: '',
order: '', order: '',
@ -476,6 +514,7 @@
tabs: [], tabs: [],
storeScroll: true, storeScroll: true,
storeTop: 0, storeTop: 0,
navHeight: 0,
currSpid: "", currSpid: "",
topicList: [], topicList: [],
service_open: false, service_open: false,
@ -486,13 +525,7 @@
headHeight: 0, headHeight: 0,
asideMenu: [], asideMenu: [],
asideCurr: '', asideCurr: '',
CartCount: 0, CartCount: 0
navHeight: 0,
listTop: 0,
mer_type: '', //
secondTabList: [],
secondTabCurr: '', //
isChangeSecTabStyle: false
} }
}, },
computed: { computed: {
@ -549,7 +582,6 @@
break; break;
case 7: case 7:
this.resetParmas(); this.resetParmas();
this.getMerClassifly();
this.goods = []; this.goods = [];
this.getGoods(); this.getGoods();
break; break;
@ -580,9 +612,8 @@
} }
} }
// #endif // #endif
//
this.getStore(); this.getStore();
// this.diyData(); this.diyData();
shareScence(this.currSpid, this.isLogin); shareScence(this.currSpid, this.isLogin);
this.initHeight(); this.initHeight();
@ -603,8 +634,6 @@
}) })
this.getMerClassifly(); this.getMerClassifly();
//
this.getCart(); this.getCart();
}, },
@ -637,111 +666,46 @@
}, },
// #endif // #endif
methods: { methods: {
// //
getCart() { getCart() {
let that = this; let that = this;
console.log(111)
getCartCounts({ getCartCounts({
sale_type: this.where.sale_type sale_type: this.where.sale_type
}).then(res => { }).then(res => {
console.log(res)
that.CartCount = res.data[0].count; that.CartCount = res.data[0].count;
}); });
}, },
// //
onChangeAsideMenu(e) { onChangeAsideMenu(e) {
//
this.getMerClassifly(e)
this.asideCurr = e; this.asideCurr = e;
this.resetParmas(); this.resetParmas();
this.goods = []; this.goods = [];
this.loadend = false; this.loadend = false;
// this.getGoods();
this.secondTabCurr = '';
this.isChangeSecTabStyle = false;
}, },
// //
getMerClassifly(pid) { getMerClassifly() {
const param = { getCategoryIndexList({
mer_type: 2, mer_type: 2,
sale_type: this.where.sale_type, sale_type: this.where.sale_type
mer_id: this.id, }).then(res => {
mer_type: '',
pid: pid
};
// ()
if (this.tabActive == 7) {
param.mer_type = 1;
}
//()
if (this.tabActive == 3) {
param.mer_type = 2;
}
getCategoryIndexList(param).then(res => {
//
if (pid) {
this.secondTabList = [{
cate_name: '全部',
store_category_id: ''
}, ...res.data];
} else { //
this.asideMenu = [{ this.asideMenu = [{
cate_name: '全部', cate_name: '全部',
store_category_id: '' store_category_id: ''
}, ...res.data]; }, ...res.data];
}
this.getGoods();
}) })
}, },
//
onSecondTabChange(e) {
this.isChangeSecTabStyle = false;
this.secondTabCurr = e;
this.resetParmas();
this.goods = [];
this.loadend = false;
this.getGoods();
},
//
tab: function(param) {
if (param == 9) return uni.switchTab({
url: "/pages/order_addcart/order_addcart"
});
this.tabActive = param;
this.goodsLoading = this.loadend = this.loading = false;
// tab
this.secondTabCurr = '';
this.secondTabList = [];
this.asideCurr = '';
this.asideMenu = [];
this.loadend = false;
this.getMerClassifly();
},
//
onChangeSecTabStyle() {
this.isChangeSecTabStyle = !this.isChangeSecTabStyle;
},
// navbar
scrollHome: function(e) {
// uni.$emit('scroll');
// this.navShow = e.detail.scrollTop >= 50;
},
navTo(url) { navTo(url) {
uni.navigateTo({ uni.navigateTo({
url: url url: url
}) })
}, },
// //
showMaoLocation: function() { showMaoLocation: function() {
if (!this.store.lat || !this.store.long) return this if (!this.store.lat || !this.store.long) return this
@ -779,9 +743,10 @@
this.$nextTick(async () => { this.$nextTick(async () => {
const headHeight = await this.getDomInfo('.header'); const headHeight = await this.getDomInfo('.header');
const footerHeight = await this.getDomInfo('.footer'); const footerHeight = await this.getDomInfo('.footer');
const navObj = await this.getDomInfo('.nav'); const navHeight = await this.getDomInfo('#nav-cont');
this.headHeight = headHeight;
this.listHeight = headHeight.height + footerHeight.height + navObj.height + 'px'; this.listHeight = headHeight.height + footerHeight.height + 'px';
}) })
}, },
@ -954,6 +919,7 @@
}, },
// //
getGoods: function() { getGoods: function() {
console.log(2)
let that = this; let that = this;
if (that.loadend) return; if (that.loadend) return;
if (that.loading) return; if (that.loading) return;
@ -961,10 +927,6 @@
that.goodsLoading = true; that.goodsLoading = true;
that.loadTitle = ''; that.loadTitle = '';
if (that.secondTabCurr) //
that.where.cate_pid = that.secondTabCurr;
else //
that.where.cate_pid = that.asideCurr; that.where.cate_pid = that.asideCurr;
if (this.tabActive == 7) getStoreCloudGoods(that.id, that.where).then(res => { if (this.tabActive == 7) getStoreCloudGoods(that.id, that.where).then(res => {
@ -1174,6 +1136,11 @@
} }
}) })
}, },
// navbar
scrollHome: function(e) {
uni.$emit('scroll');
this.navShow = e.detail.scrollTop >= 50;
},
goback: function() { goback: function() {
uni.navigateBack(); uni.navigateBack();
@ -1185,6 +1152,16 @@
}); });
}, },
//
tab: function(param) {
console.log(param)
if (param == 9) return uni.switchTab({
url: "/pages/order_addcart/order_addcart"
})
this.tabActive = param;
this.goodsLoading = this.loadend = this.loading = false
},
resetParmas() { resetParmas() {
this.navActive = 0; this.navActive = 0;
this.where = { this.where = {
@ -1192,8 +1169,7 @@
keyword: '', keyword: '',
page: 1, page: 1,
limit: 30, limit: 30,
sale_type: this.where.sale_type, sale_type: this.where.sale_type
cate_pid: ''
} }
}, },
@ -1244,7 +1220,6 @@
} }
}, },
onPageScroll() { onPageScroll() {
this.isChangeSecTabStyle = false;
uni.$emit('scroll'); uni.$emit('scroll');
}, },
onPullDownRefresh() { onPullDownRefresh() {
@ -1259,104 +1234,10 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.small-classify {
position: fixed;
left: 152rpx;
min-height: 94rpx;
background: #fff;
z-index: 100;
padding: 20rpx 20rpx 10rpx;
box-sizing: border-box;
.second-item-con-wrap {
position: relative;
display: flex;
align-items: center;
.second-item-con {
display: flex;
width: 95%;
overflow: auto;
}
.sanjiaoxing {
position: absolute;
right: -2rpx;
top: 20rpx;
width: 0;
height: 0;
border: 12rpx solid;
border-color: #333 transparent transparent transparent;
margin-left: 4rpx;
}
}
.small-classify-item {
flex-shrink: 0;
padding: 10rpx 40rpx;
border-radius: 4rpx;
font-size: 24rpx;
color: #999;
background: #F6F6F6;
text-align: center;
margin-right: 10rpx;
margin-bottom: 10rpx;
}
.small-classify-item-active {
background: #ECFFE8;
color: #40AE36;
}
}
.tab-cont { .tab-cont {
background: #f5f5f5; background: #f5f5f5;
min-height: 500rpx; min-height: 500rpx;
overflow: auto; overflow: auto;
display: flex;
.aside-left-placeholder {
width: 152rpx;
}
.aside-left {
position: fixed;
left: 0;
z-index: 2;
width: 152rpx;
overflow-y: auto;
background-color: #F4F4F4;
.aside-left-item {
width: 100%;
height: 94rpx;
line-height: 94rpx;
text-align: center;
padding: 0 14rpx;
}
.aside-active {
position: relative;
font-weight: bold;
font-size: 26rpx;
color: #40AE36;
background-color: #fff;
&::before {
content: "";
display: inline-block;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 6rpx;
height: 36rpx;
background: #40AE36;
border-radius: 0rpx 4rpx 4rpx 0rpx;
}
}
}
} }
.car-number { .car-number {
@ -1544,119 +1425,6 @@
} }
} }
.nav {
padding: 0 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 90rpx;
background: #fff;
border-bottom: 1px solid #f3f3f3;
z-index: 10;
.nav-cont {
display: flex;
align-items: center;
height: 84rpx;
.item {
display: flex;
justify-content: center;
align-items: center;
min-width: 0;
.cont {
display: flex;
justify-content: center;
align-items: center;
width: 116rpx;
height: 44rpx;
border-radius: 22rpx;
font-weight: 500;
font-size: 24rpx;
color: #666666;
.arrow-icon {
margin-left: 10rpx;
font-size: 18rpx;
}
.layout-icon {
font-size: 32rpx;
}
.icon-pailie {
font-size: 32rpx;
}
image {
width: 15rpx;
height: 21rpx;
margin-left: 7rpx;
}
}
}
.active {
.cont {
font-size: 28rpx;
font-weight: bold;
color: var(--view-theme);
}
}
}
.guanzhu {
width: 146rpx;
height: 58rpx;
line-height: 58rpx;
background: #46B03A;
border-radius: 68rpx 68rpx 68rpx 68rpx;
font-weight: 600;
font-size: 28rpx;
color: #FFFFFF;
text-align: center;
}
.guanzhu-active {
background: transparent;
border: 2rpx solid #46B03A;
color: #46B03A;
}
.select {
position: absolute;
top: 100%;
left: 0;
z-index: 2;
width: 100%;
padding-right: 40rpx;
padding-bottom: 28rpx;
padding-left: 74rpx;
border-bottom-right-radius: 24rpx;
border-bottom-left-radius: 24rpx;
background-color: #FFFFFF;
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.06);
.item {
margin-top: 28rpx;
font-size: 24rpx;
color: #454545;
}
.active {
color: var(--view-theme);
.iconfont {
color: var(--view-theme);
float: right;
font-size: 20rpx;
}
}
}
}
.main_count { .main_count {
background-color: #ffffff; background-color: #ffffff;
padding: 30rpx 20rpx; padding: 30rpx 20rpx;
@ -1815,6 +1583,117 @@
} }
} }
.nav {
position: relative;
padding: 0 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
border-bottom: 1px solid #f3f3f3;
.nav-cont {
display: flex;
align-items: center;
height: 84rpx;
.item {
display: flex;
justify-content: center;
align-items: center;
min-width: 0;
.cont {
display: flex;
justify-content: center;
align-items: center;
width: 116rpx;
height: 44rpx;
border-radius: 22rpx;
font-weight: 500;
font-size: 24rpx;
color: #666666;
.arrow-icon {
margin-left: 10rpx;
font-size: 18rpx;
}
.layout-icon {
font-size: 32rpx;
}
.icon-pailie {
font-size: 32rpx;
}
image {
width: 15rpx;
height: 21rpx;
margin-left: 7rpx;
}
}
}
.active {
.cont {
font-size: 28rpx;
font-weight: bold;
color: var(--view-theme);
}
}
}
.guanzhu {
width: 146rpx;
height: 58rpx;
line-height: 58rpx;
background: #46B03A;
border-radius: 68rpx 68rpx 68rpx 68rpx;
font-weight: 600;
font-size: 28rpx;
color: #FFFFFF;
text-align: center;
}
.guanzhu-active {
background: transparent;
border: 2rpx solid #46B03A;
color: #46B03A;
}
.select {
position: absolute;
top: 100%;
left: 0;
z-index: 2;
width: 100%;
padding-right: 40rpx;
padding-bottom: 28rpx;
padding-left: 74rpx;
border-bottom-right-radius: 24rpx;
border-bottom-left-radius: 24rpx;
background-color: #FFFFFF;
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.06);
.item {
margin-top: 28rpx;
font-size: 24rpx;
color: #454545;
}
.active {
color: var(--view-theme);
.iconfont {
color: var(--view-theme);
float: right;
font-size: 20rpx;
}
}
}
}
.goods { .goods {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -2355,7 +2234,7 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin: 0 auto; margin-top: 0;
image { image {
width: 414rpx; width: 414rpx;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -176,11 +176,11 @@
<view class="user-menus" style="margin-top: 20rpx;"> <view class="user-menus" style="margin-top: 20rpx;">
<view class="title skeleton-rect">我的服务</view> <view class="title skeleton-rect">我的服务</view>
<view class="menu-box"> <view class="menu-box">
<block v-for="(item,index) in personalMenu" :key="index" :id="'target'+index"> <block v-for="(item,index) in personalMenu" :key="index">
<view v-if="item.isShow" class="item"> <view v-if="item.isShow" class="item">
<view @click="authTo(item.url,item.name)" class="item-count"> <view @click="authTo(item.url)" class="item-count">
<image v-if="showSkeleton" class="skeleton_image skeleton-radius"></image> <image v-if="showSkeleton" class="skeleton_image skeleton-radius"></image>
<image v-else :src="item.pic" class="targets"></image> <image v-else :src="item.pic"></image>
<text>{{item.name}}</text> <text>{{item.name}}</text>
</view> </view>
</view> </view>
@ -305,9 +305,7 @@
import { import {
toLogin toLogin
} from '@/libs/login.js'; } from '@/libs/login.js';
import { import {showTab} from "@/utils/showTab.js";
showTab
} from "@/utils/showTab.js";
const app = getApp(); const app = getApp();
export default { export default {
components: { components: {
@ -333,11 +331,9 @@
}, },
data() { data() {
return { return {
elInfo: '',
//#ifdef H5 //#ifdef H5
isWeixin: this.$wechat.isWeixin(), isWeixin: this.$wechat.isWeixin(),
//#endif //#endif
subNvue: '',
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
showSkeleton: true, // showSkeleton: true, //
isNodes: 0, //, isNodes: 0, //,
@ -462,9 +458,6 @@
}, },
onLoad() { onLoad() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.$on('offuserSubnvue', () => {
this.subNvue.hide('slide-out-right');
})
this.appVersion = 'V ' + uni.getSystemInfoSync().appWgtVersion; this.appVersion = 'V ' + uni.getSystemInfoSync().appWgtVersion;
// #endif // #endif
// #ifdef H5 // #ifdef H5
@ -473,52 +466,12 @@
if (ENV != 'prod') this.appVersion += " Beta" if (ENV != 'prod') this.appVersion += " Beta"
}, },
onReady() { onReady() {
// #ifdef APP
this.isNodes++; this.isNodes++;
let that = this
// setTimeout(() => {
// const query = uni.createSelectorQuery().in(this);
// query
// .select(".targets")
// .boundingClientRect((data) => {
// that.elInfo = data
// // #ifdef APP-PLUS
// if (Boolean(uni.getStorageSync('newStore'))) {
// that.subNvue = uni.getSubNVueById('userSubnvu')
// that.subNvue.show('slide-in-left', 300)
// uni.$emit('openUserSubnvue', JSON.stringify(data))
// }
// // #endif
// })
// .exec();
// }, 500)
// #endif
}, },
mounted: function() { mounted: function() {
this.getVersion() this.getVersion()
}, },
onShow: function() { onShow: function() {
// #ifdef APP-PLUS
setTimeout(() => {
const query = uni.createSelectorQuery().in(this);
query
.select(".targets")
.boundingClientRect((data) => {
that.elInfo = data
// #ifdef APP-PLUS
if (Boolean(uni.getStorageSync('newStore'))) {
that.subNvue = uni.getSubNVueById('userSubnvu')
that.subNvue.show('slide-in-left', 300)
uni.$emit('openUserSubnvue', JSON.stringify(data))
}
// #endif
})
.exec();
}, 800)
// #endif
let that = this; let that = this;
let routes = getCurrentPages(); let routes = getCurrentPages();
let curRoute = routes[routes.length - 1].route let curRoute = routes[routes.length - 1].route
@ -526,7 +479,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
@ -541,16 +494,10 @@
}, 500) }, 500)
}, },
methods: { methods: {
authTo(url, name) { authTo(url) {
if (this.isLogin) { if (this.isLogin) {
let txt = "";
if (this.userInfo && this.userInfo.service && name == "商家入驻") {
txt = url + '?step=3'
} else {
txt = url;
}
uni.navigateTo({ uni.navigateTo({
url: txt url: url
}) })
} else { } else {
this.openAuto() this.openAuto()
@ -577,6 +524,7 @@
} else { } else {
this.openAuto() this.openAuto()
} }
}, },
goRouter(item) { goRouter(item) {
var pages = getCurrentPages(); var pages = getCurrentPages();
@ -693,54 +641,26 @@
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 = Number(data.noPay) + Number(data.mer_noPay); item.num = data.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 = Number(data.noPostage) + Number(data.mer_noPostage); item.num = data.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 = Number(data.noDeliver) + Number(data.mer_noDeliver); item.num = data.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 = Number(data.noComment) + Number(data.mer_noComment); item.num = data.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
@ -1343,11 +1263,11 @@
.iconnum { .iconnum {
min-width: 6px; min-width: 6px;
background-color: red; background-color: #fff;
color: #fff; color: var(--view-theme);
border-radius: 15rpx; border-radius: 15rpx;
position: absolute; position: absolute;
left: 50rpx; right: -10rpx;
top: -10rpx; top: -10rpx;
font-size: 10px; font-size: 10px;
padding: 0 4px; padding: 0 4px;

View File

@ -1,179 +0,0 @@
<template>
<view class="">
<view class="jump" @click="next">
<text class="font">跳过</text>
</view>
<view class="next-btn center" :style="{ left:screenWidth/2,top:(screenHeight-96)}">
<text class="next-btn-text font" style="line-height: 76rpx;" @click="next">我知道了</text>
</view>
<view class="target" :style="{left:left-20,top:top-13.5}">
<image src="http://lihai001.oss-cn-chengdu.aliyuncs.com/def/6202d269b6163b9ec7a4383559fc67a8.png"
class="target-icon"></image>
<text class="target-text">商家入驻</text>
</view>
<view :style="{left:left-20+'px',top:top-70+'px'}" class="trans1">
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;"></image>
</view>
<view class="tips-box" :style="{left:left-13.5,top:top-154}">
<view class="tips" style="position: absolute;padding-left: 20px;">
<view class="tras" :class="{act:isAct}">
<text style="font-size: 28rpx;line-height: 100rpx;color: white;">点击商户入驻,轻松开店</text>
</view>
</view>
<image src="/static/images/starpng.png" class="start" mode="">
</image>
</view>
<image src="/static/images/greenLine.png" class="greenLine" :style="{left:left-3.5,top:top-70}" mode="">
</image>
</view>
</template>
<script>
export default {
data() {
return {
screenHeight: 0,
screenWidth: 0,
isAct: false,
left: -100,
top: -100,
}
},
methods: {
next() {
uni.$emit('offuserSubnvue');
uni.setStorageSync("newStore", false)
}
},
onLoad() {
let that = this
uni.$on('openUserSubnvue', (data) => {
console.log('data')
console.log(data)
this.left = JSON.parse(data).left
this.top = JSON.parse(data).top
console.log(this.left, this.top)
})
const res = uni.getSystemInfo({
success: (res => {
this.screenHeight = res.screenHeight
this.screenWidth = res.screenWidth
})
});
setTimeout(() => {
that.isAct = true
}, 500)
}
}
</script>
<style>
.jump {
position: absolute;
right: 30rpx;
top: 80rpx;
border: 1px solid white;
padding: 10rpx 20rpx;
border-radius: 30rpx;
}
.font {
font-size: 28rpx;
color: white;
lines: 1;
text-align: center;
}
.center {
transform: translateX(-50%);
}
.next-btn {
position: absolute;
width: 240rpx;
height: 76rpx;
border: 1px solid white;
border-radius: 38rpx;
background: rgba(255, 255, 255, 0.4);
}
.target {
width: 136rpx;
height: 136rpx;
background-color: white;
border-radius: 136rpx;
}
.target-icon {
width: 50rpx;
height: 50rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, -50%);
top: 68rpx;
}
.target-text {
font-size: 20rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, 0);
top: 100rpx;
}
.pointer {
position: absolute;
}
.tips-box {
width: 462rpx;
height: 178rpx;
position: absolute;
padding-top: 72rpx;
position: absolute;
}
.start {
width: 72rpx;
height: 72rpx;
position: absolute;
right: 0;
top: 20px;
}
.tips {
width: 462rpx;
height: 106rpx;
background-color: #5BE157;
border-radius: 20rpx;
}
.tras {
width: 0px;
transition-property: width;
transition-duration: 3s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.trans1 {
/* transition-property: left, top;
transition-duration: 3s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0); */
}
.act {
width: 462rpx;
}
.greenLine {
width: 35px;
height: 60px;
position: absolute;
}
</style>

View File

@ -1,7 +1,6 @@
<template> <template>
<div :style="viewColor"> <div :style="viewColor">
<div class="register_main" <div class="register_main" :style="{ 'background-image': formItem == 1 ? `url(${domain}/static/images/logo_bgl.png)` : `url(${domain}/static/images/logo_bgh.png)`}">
:style="{ 'background-image': formItem == 1 ? `url(${domain}/static/images/logo_bgl.png)` : `url(${domain}/static/images/logo_bgh.png)`}">
<view class="system-height" :style="{ height: statusBarHeight }"></view> <view class="system-height" :style="{ height: statusBarHeight }"></view>
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<view class="title-bar" style="height: 43px;"> <view class="title-bar" style="height: 43px;">
@ -22,15 +21,12 @@
<div class="list" :hidden="current !== 0"> <div class="list" :hidden="current !== 0">
<form @submit.prevent="submit"> <form @submit.prevent="submit">
<div class="item"> <div class="item">
<input type="text" placeholder="请输入手机号或账号" placeholder-class="placeholder" <input type="text" placeholder="请输入手机号或账号" placeholder-class="placeholder" v-model="account" required />
v-model="account" required />
</div> </div>
<div class="item"> <div class="item">
<input type="password" placeholder="填写登录密码" placeholder-class="placeholder" <input type="password" placeholder="填写登录密码" placeholder-class="placeholder" v-model="password" required />
v-model="password" required /> <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
<navigator class="forgetPwd" hover-class="none" 忘记密码
url="/pages/users/retrievePassword/index">
忘记密we码
</navigator> </navigator>
</div> </div>
</form> </form>
@ -41,10 +37,8 @@
<input type="text" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" /> <input type="text" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" />
</div> </div>
<div class="item"> <div class="item">
<input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" <input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" v-model="captcha" />
v-model="captcha" /> <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="handleVerify">
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
@click="handleVerify">
{{ text }} {{ text }}
</button> </button>
</div> </div>
@ -59,9 +53,7 @@
<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>
class="font_pro">用户协议</text><text @click="userPrivacyAgree"
class="font_pro">隐私政策</text></text>
</checkbox-group> </checkbox-group>
</div> </div>
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
@ -91,23 +83,17 @@
<input type="text" placeholder="请输入手机号" placeholder-class="placeholder" v-model="account" /> <input type="text" placeholder="请输入手机号" placeholder-class="placeholder" v-model="account" />
</div> </div>
<div class="item"> <div class="item">
<input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" <input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" v-model="captcha" />
v-model="captcha" /> <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="handleVerify">
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
@click="handleVerify">
{{ text }} {{ text }}
</button> </button>
</div> </div>
<div class="item"> <div class="item">
<input type="password" placeholder="填写您的登录密码" placeholder-class="placeholder" <input type="password" placeholder="填写您的登录密码" placeholder-class="placeholder" v-model="password" />
v-model="password" />
</div> </div>
<div class="item" v-if="isShowCode"> <div class="item" v-if="isShowCode">
<input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" <input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" v-model="codeVal" />
v-model="codeVal" /> <div class="code" @click="getcaptcha"><image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" /></div>
<div class="code" @click="getcaptcha">
<image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" />
</div>
</div> </div>
</div> </div>
<div class="tip"> <div class="tip">
@ -118,9 +104,7 @@
<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>
class="font_pro">用户协议</text><text @click="userPrivacyAgree"
class="font_pro">隐私政策</text></text>
</checkbox-group> </checkbox-group>
</div> </div>
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
@ -151,27 +135,21 @@
</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' v-model="account"></input>
v-model="account"></input>
</view> </view>
<view class="item"> <view class="item">
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' <input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" v-model="captcha"></input>
class="codeIput" v-model="captcha"></input> <button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="handleVerify">
<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled'
@click="handleVerify">
{{ text }} {{ text }}
</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"> <view class="protocol acea-row">
<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>
class="font_pro">用户协议</text><text @click="userPrivacyAgree"
class="font_pro">隐私政策</text></text>
</checkbox-group> </checkbox-group>
</view> </view>
</view> </view>
@ -182,8 +160,7 @@
</form> </form>
<view class="copyright" @click="goCopyUrl">{{copyData}}</view> <view class="copyright" @click="goCopyUrl">{{copyData}}</view>
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" <Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
ref="verify"></Verify>
</div> </div>
</div> </div>
</template> </template>
@ -213,10 +190,7 @@
loginMpPhone loginMpPhone
} from "@/api/user"; } from "@/api/user";
// #ifdef APP-PLUS // #ifdef APP-PLUS
import { import { wechatAppAuth, appleAppAuth } from '@/api/api.js'
wechatAppAuth,
appleAppAuth
} from '@/api/api.js'
// #endif // #endif
import attrs, { import attrs, {
required, required,
@ -235,16 +209,10 @@
VUE_APP_API_URL, VUE_APP_API_URL,
configMap configMap
} from "@/utils"; } from "@/utils";
import { import { HTTP_REQUEST_URL } from '@/config/app';
HTTP_REQUEST_URL
} from '@/config/app';
import parser from "@/components/jyf-parser/jyf-parser"; import parser from "@/components/jyf-parser/jyf-parser";
import { import { commonAuth } from '../../../api/public';
commonAuth import { mapGetters} from "vuex";
} from '../../../api/public';
import {
mapGetters
} from "vuex";
import Verify from '@/components/verify/verify.vue'; import Verify from '@/components/verify/verify.vue';
const BACK_URL = "login_back_url"; const BACK_URL = "login_back_url";
@ -288,8 +256,7 @@
computed:{ computed:{
...configMap(['login_logo','wechat_phone_switch'], mapGetters(['viewColor'])), ...configMap(['login_logo','wechat_phone_switch'], mapGetters(['viewColor'])),
copyData() { copyData() {
let copy = this.copyright.status == -1 ? this.copyright.year + " " + this.copyright.url : this.copyright let copy = this.copyright.status == -1 ? this.copyright.year+" "+this.copyright.url : this.copyright.Copyright
.Copyright
return copy; return copy;
} }
}, },
@ -359,8 +326,7 @@
that.$store.commit('UPDATE_USERINFO', data.user); that.$store.commit('UPDATE_USERINFO', data.user);
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/plant_grass/index' '/pages/user/index','/pages/plant_grass/index'
] ]
if (indexPat.includes(this.getPath(backUrl))) { if (indexPat.includes(this.getPath(backUrl))) {
@ -473,11 +439,9 @@
auth: { auth: {
userInfo: that.appleUserInfo, userInfo: that.appleUserInfo,
openId: that.appleUserInfo.openId, openId: that.appleUserInfo.openId,
nickname: (that.appleUserInfo.fullName.familyName || '') + (that.appleUserInfo.fullName nickname: (that.appleUserInfo.fullName.familyName || '') + (that.appleUserInfo.fullName.giveName || ''),
.giveName || ''),
} }
} }}).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(BACK_URL) || "/pages/index/index"; const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
@ -489,8 +453,7 @@
that.$store.commit("SETUID", data.result.user.uid); that.$store.commit("SETUID", data.result.user.uid);
that.$store.commit('UPDATE_USERINFO', data.result.user); that.$store.commit('UPDATE_USERINFO', data.result.user);
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/plant_grass/index' '/pages/user/index','/pages/plant_grass/index'
] ]
if (indexPat.includes(this.getPath(backUrl))) { if (indexPat.includes(this.getPath(backUrl))) {
@ -564,8 +527,7 @@
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(BACK_URL) || "/pages/index/index"; const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
@ -577,8 +539,7 @@
that.$store.commit("SETUID", data.result.user.uid); that.$store.commit("SETUID", data.result.user.uid);
that.$store.commit('UPDATE_USERINFO', data.result.user); that.$store.commit('UPDATE_USERINFO', data.result.user);
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/plant_grass/index' '/pages/user/index','/pages/plant_grass/index'
] ]
if (indexPat.includes(this.getPath(backUrl))) { if (indexPat.includes(this.getPath(backUrl))) {
@ -671,8 +632,7 @@
that.$store.commit('UPDATE_USERINFO', data.user); that.$store.commit('UPDATE_USERINFO', data.user);
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))) {
@ -832,8 +792,7 @@
that.$store.commit('UPDATE_USERINFO', data.user); that.$store.commit('UPDATE_USERINFO', data.user);
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))) {
@ -889,13 +848,11 @@
width: 28rpx; width: 28rpx;
height: 28rpx; height: 28rpx;
} }
/deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked, /deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked,
/deep/checkbox .wx-checkbox-input.wx-checkbox-input-checked { /deep/checkbox .wx-checkbox-input.wx-checkbox-input-checked {
border: 1px solid var(--view-theme)!important; border: 1px solid var(--view-theme)!important;
background-color: var(--view-theme)!important; background-color: var(--view-theme)!important;
} }
.ChangePassword .phone { .ChangePassword .phone {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
@ -919,23 +876,18 @@
height: 100%; height: 100%;
font-size: 32rpx; font-size: 32rpx;
} }
.ChangePassword .list .item .placeholder { .ChangePassword .list .item .placeholder {
color: #bbbbbb; color: #bbbbbb;
} }
.ChangePassword .list .item input.codeIput { .ChangePassword .list .item input.codeIput {
width: 240rpx; width: 240rpx;
} }
.register .whiteBg .title_info text{ .register .whiteBg .title_info text{
color: var(--view-theme); color: var(--view-theme);
} }
.register .list .item .code { .register .list .item .code {
color: var(--view-theme); color: var(--view-theme);
} }
.title-bar { .title-bar {
position: relative; position: relative;
display: flex; display: flex;
@ -945,7 +897,6 @@
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
line-height: 48rpx; line-height: 48rpx;
.icon { .icon {
position: absolute; position: absolute;
left: 30rpx; left: 30rpx;
@ -955,7 +906,6 @@
justify-content: center; justify-content: center;
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
image { image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
@ -973,18 +923,15 @@
margin: 40rpx auto 0 auto; margin: 40rpx auto 0 auto;
text-align: center; text-align: center;
line-height: 90rpx; line-height: 90rpx;
.iconfont{ .iconfont{
font-size: 32rpx; font-size: 32rpx;
margin-right: 12rpx; margin-right: 12rpx;
} }
} }
.code image { .code image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.settlementAgreement { .settlementAgreement {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -994,50 +941,41 @@
background: rgba(0, 0, 0, .5); background: rgba(0, 0, 0, .5);
z-index: 10; z-index: 10;
} }
.protocol_text{ .protocol_text{
color: #999; color: #999;
font-size: 24rpx; font-size: 24rpx;
} }
.protocol{ .protocol{
margin-top: 82rpx; margin-top: 82rpx;
justify-content: center; justify-content: center;
} }
.protocol_text{ .protocol_text{
.font_pro{ .font_pro{
color: var(--view-theme); color: var(--view-theme);
} }
} }
.appLogin { .appLogin {
margin-top: 82rpx; margin-top: 82rpx;
.hds { .hds {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
color: #B4B4B4; color: #B4B4B4;
.line { .line {
width: 68rpx; width: 68rpx;
height: 1rpx; height: 1rpx;
background: #CCCCCC; background: #CCCCCC;
} }
p { p {
margin: 0 20rpx; margin: 0 20rpx;
} }
} }
.btn-wrapper { .btn-wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 30rpx; margin-top: 30rpx;
.btn { .btn {
display: flex; display: flex;
align-items: center; align-items: center;
@ -1045,12 +983,10 @@
width: 68rpx; width: 68rpx;
height: 68rpx; height: 68rpx;
border-radius: 50%; border-radius: 50%;
+ .btn { + .btn {
margin-left: 30rpx; margin-left: 30rpx;
} }
} }
.apple-btn { .apple-btn {
display: flex; display: flex;
align-items: center; align-items: center;
@ -1061,38 +997,31 @@
background: #EAEAEA; background: #EAEAEA;
border-radius: 34rpx; border-radius: 34rpx;
font-size: 24rpx; font-size: 24rpx;
.icon-s-pingguo { .icon-s-pingguo {
color: #333; color: #333;
margin-right: 10rpx; margin-right: 10rpx;
font-size: 34rpx; font-size: 34rpx;
} }
} }
.iconfont { .iconfont {
font-size: 40rpx; font-size: 40rpx;
color: #fff; color: #fff;
} }
.wx { .wx {
background-color: #61C64F; background-color: #61C64F;
&.btn-apple{ &.btn-apple{
margin-right: 0; margin-right: 0;
background-color: #333; background-color: #333;
} }
} }
.mima { .mima {
background-color: #28B3E9; background-color: #28B3E9;
} }
.yanzheng { .yanzheng {
background-color: #F89C23; background-color: #F89C23;
} }
} }
} }
.whiteBg .logon { .whiteBg .logon {
display: flex; display: flex;
align-items: center; align-items: center;
@ -1105,17 +1034,14 @@
color: #FFFFFF; color: #FFFFFF;
font-size: 30rpx; font-size: 30rpx;
} }
.whiteBg .back{ .whiteBg .back{
border: 1px solid var(--view-theme); border: 1px solid var(--view-theme);
color: var(--view-theme); color: var(--view-theme);
margin-top: 30rpx; margin-top: 30rpx;
background-color: transparent; background-color: transparent;
} }
.login-wrapper { .login-wrapper {
padding: 30rpx; padding: 30rpx;
.shading { .shading {
display: flex; display: flex;
align-items: center; align-items: center;
@ -1126,7 +1052,6 @@
/* #endif */ /* #endif */
/* #ifndef APP-VUE */ /* #ifndef APP-VUE */
margin-top: 200rpx; margin-top: 200rpx;
/* #endif */ /* #endif */
image { image {
width: 180rpx; width: 180rpx;
@ -1134,7 +1059,6 @@
} }
} }
} }
.copyright { .copyright {
position: fixed; position: fixed;
bottom: 30rpx; bottom: 30rpx;

View File

@ -1,186 +1,167 @@
<template> <template>
<view :style="viewColor"> <div :style="viewColor">
<view class="register absolute" v-if="!auth_token">
<!-- <view class="login" style="background-size: 100% 100%;background-repeat: no-repeat;"> -->
<view class="login">
<view class="shading">
<view class="pictrue acea-row row-center-wrapper" style="background-color: transparent !important;">
<image src="@/static/images/logo1.png" />
</view>
</view>
<view class="" style="margin-top: 10rpx;" v-if='formItem==2'>
<view style="text-align: center;font-size: 36rpx;color: #20B128;font-weight: 700;">
重置密码
</view>
<view style="text-align: center;color: #BCBCBC;font-size: 24rpx;margin-top: 10rpx;">
请输入手机号码和验证码找回密码重置
</view>
</view>
<view class="whiteBg" v-if="formItem == 0">
<view class="logon" style="display: flex;align-items: center;justify-content: center;"
@click="wxLogin">
<u-icon name="weixin-fill" color="#fff" size="30"></u-icon> 微信一键登录
</view>
<view class="protocol acea-row row-between-wrapper"> <div class="register absolute" v-if="!auth_token">
<div class="login" style="background-size: 100% 100%;background-repeat: no-repeat;">
<div class="shading" >
<div class="pictrue acea-row row-center-wrapper" style="background-color: transparent !important;">
<image src="@/static/images/logo1.png" />
</div>
</div>
<div class="whiteBg" v-if="formItem == 0">
<div class="logon" style="display: flex;align-items: center;justify-content: center;" @click="wxLogin">
<u-icon name="weixin-fill" color="#fff" size="30"></u-icon> 微信一键登录
</div>
<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>
</view> </div>
</view> </div>
<view class="whiteBg" v-else-if="formItem === 1"> <div class="whiteBg" v-else-if="formItem === 1" style="po">
<view class="title acea-row row-center-wrapper"> <div class="title acea-row row-center-wrapper">
<view 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"
@click="navTap(index)" :key="index"> @click="navTap(index)" :key="index">
{{ item }} {{ item }}
</view> </div>
</view> </div>
<view class="list" :hidden="current !== 1"> <div class="list" :hidden="current !== 1">
<form @submit.prevent="submit"> <form @submit.prevent="submit">
<view class="item"> <div class="item">
<view class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image> <image src="/static/images/phone_1.png"></image>
<input type="number" placeholder="输入账号" placeholder-class="placeholder" <input type="number" placeholder="输入账号" placeholder-class="placeholder"
v-model="account" required /> v-model="account" required />
</view> </div>
</view> </div>
<view class="item"> <div class="item">
<view class="acea-row row-middle"> <div class="acea-row row-middle">
<image v-if="type1" @click="type1=false" src="/static/images/eye.png"></image> <image src="/static/images/code_2.png"></image>
<image v-else @click="type1=true" src="/static/images/offeye.png"></image> <input type="password" placeholder="填写登录密码" placeholder-class="placeholder"
<input style="border: none; outline:none;outline:0" :type="type1?'password':'input'" v-model="password" required />
placeholder="填写登录密码" placeholder-class="placeholder" v-model="password" </div>
required /> </div>
<button class="code" @click="formItem=2">
忘记密码
</button>
</view>
</view>
</form> </form>
</view> <div class="tip">
<view class="list" :hidden="current !== 0"> <!-- <span @click="formItem = 2" class="font-color-red">立即注册</span> -->
<view class="item"> <span> </span>
<view class="acea-row row-middle"> <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
忘记密码
</navigator>
</div>
</div>
<div class="list" :hidden="current !== 0">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image> <image src="/static/images/phone_1.png"></image>
<input type="number" placeholder="输入手机号码" placeholder-class="placeholder" <input type="number" placeholder="输入手机号码" placeholder-class="placeholder"
v-model="account" /> v-model="account" />
</view> </div>
</view> </div>
<view class="item">
<view class="acea-row row-middle"> <div class="item">
<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" v-model="captcha" maxlength="4" /> <input type="number" placeholder="填写验证码" placeholder-class="placeholder" 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 }}
</button> </button>
</view> </div>
</view> </div>
<view class="item" v-if="isShowCode"> <div class="item" v-if="isShowCode">
<view 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" <input type="number" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput"
class="codeIput" v-model="codeVal" maxlength="4" /> v-model="codeVal" maxlength="4" />
<view 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" />
</view> </div>
</view> </div>
</view> </div>
</view> </div>
<view class="logon" @click="loginMobile" :hidden="current !== 0">登录</view> <div class="logon" @click="loginMobile" :hidden="current !== 0">登录</div>
<view class="logon" @click="submit" :hidden="current === 0">账号登录</view> <div class="logon" @click="submit" :hidden="current === 0">登录</div>
<view 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>
</view> </div>
</view> </div>
<div class="whiteBg" v-else>
<view class="whiteBg" style="margin-top: 0;" v-else-if='formItem==2'> <div class="title">注册账号</div>
<view class="list"> <div class="list">
<view class="item"> <div class="item">
<view class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image> <image src="/static/images/phone_1.png"></image>
<input type="number" placeholder="输入手机号码" placeholder-class="placeholder" <input type="number" placeholder="输入手机号码" placeholder-class="placeholder"
v-model="account" /> v-model="account" />
</view> </div>
</view> </div>
<view class="item"> <div class="item">
<view 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" <input type="number" placeholder="填写验证码" maxLength='4' placeholder-class="placeholder" class="codeIput"
class="codeIput" v-model="captcha" /> 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">
{{ text }} {{ text }}
</button> </button>
</view> </div>
</view> </div>
<view class="item"> <div class="item">
<view class="acea-row row-middle"> <div class="acea-row row-middle">
<image v-if="type2" @click="type2=false" src="/static/images/eye.png"></image> <image src="/static/images/code_1.png"></image>
<image v-else @click="type2=true" src="/static/images/offeye.png"></image> <input type="password" placeholder="填写您的登录密码" placeholder-class="placeholder"
<input :type="type2?'password':'input'" placeholder="请输入新密码"
placeholder-class="placeholder" style="border: none; outline:none;outline:0"
v-model="password" /> v-model="password" />
</view> </div>
</view> </div>
<view class="item">
<view class="acea-row row-middle">
<image v-if="type3" @click="type3=false" src="/static/images/eye.png"></image>
<image v-else @click="type3=true" src="/static/images/offeye.png"></image>
<input :type="type3?'password':'input'" placeholder="请再次输入密码"
placeholder-class="placeholder" style="border: none; outline:none;outline:0"
v-model="confirm_pwd" />
</view>
</view>
<view class="item" v-if="isShowCode"> <div class="item" v-if="isShowCode">
<view 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" <input type="number" placeholder="填写验证码" maxlength="4" placeholder-class="placeholder" class="codeIput"
class="codeIput" v-model="codeVal" /> v-model="codeVal" />
<view 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" />
</view> </div>
</view> </div>
</view> </div>
</view> </div>
<view class="logon" @click="registerReset">完成并登录</view> <div class="tip">
<view class="protocol acea-row row-between-wrapper"> <div>
已有账号?
<span @click="formItem = 1" class="font-color-red">去登录</span>
</div>
</div>
<div class="logon" @click="register">注册</div>
<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>
</view> </div>
</view> </div>
<view class="footer-btn" v-if="formItem==2"> </div>
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;"> <div class="bottom"></div>
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text>
<text v-else @click="appOneClcik">本机一键登录</text>
</view>
<view class="login-type-btn" :class="{actLoginType:formItem==1}">
<text v-if='formItem == 0 ||formItem==2' @click="formItem = 1">更多登录方式</text>
<text v-else @click="appOneClcik">本机一键登录</text>
</view>
</view>
</view>
<view class="bottom"></view>
<view class="settlementAgreement" v-if="showAgreement"> <view class="settlementAgreement" v-if="showAgreement">
<view class="setAgCount"> <view class="setAgCount">
<i class="icon iconfont icon-cha" @click="showAgreement = false"></i> <i class="icon iconfont icon-cha" @click="showAgreement = false"></i>
<view class="title">用户协议与隐私政策</view> <div class="title">用户协议与隐私政策</div>
<view class="content"> <view class="content">
<jyf-parser :html="agreement" ref="article" :tag-style="tagStyle"></jyf-parser> <jyf-parser :html="agreement" ref="article" :tag-style="tagStyle"></jyf-parser>
</view> </view>
@ -188,18 +169,12 @@
</view> </view>
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<view class="footer-btns" v-if="formItem !=2"> <div class="protocol acea-row row-between-wrapper" style="position: fixed; bottom: 160rpx;left: 50%;transform: translate(-50%);">
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;"> <text class="protocol_text" v-if="formItem==0" @click="formItem = 1 ">其他方式登录</text>
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text> <text class="protocol_text" v-else @click="formItem = 0 ">微信快捷登录</text>
<text v-else @click="appOneClcik">本机一键登录</text> </div>
</view>
<view class="login-type-btn" :class="{actLoginType:formItem==1}">
<text v-if='formItem == 0 ||formItem==2' @click="formItem = 1">更多登录方式</text>
<text v-else @click="appOneClcik">本机一键登录</text>
</view>
</view>
<!-- #endif --> <!-- #endif -->
</view> </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">
@ -213,8 +188,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' <input type='number' placeholder='填写验证码' maxlength="4" placeholder-class='placeholder' class="codeIput"
class="codeIput" v-model="captcha"></input> 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">
@ -238,57 +213,14 @@
<button form-type="submit" @click="auth_token = ''" class="confirmBnt back">返回</button> <button form-type="submit" @click="auth_token = ''" class="confirmBnt back">返回</button>
</view> </view>
</form> </form>
<!-- <view class="copyright" @click="goCopyUrl">
{{ copyright.status == -1 ? `${copyright.year} ${copyright.url}` : copyright.Copyright }}
</view> -->
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" <Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
ref="verify"></Verify> ref="verify"></Verify>
<!-- tips弹窗 -->
<u-overlay :show="showTips">
<view class="tips">
<view class="" style="font-size: 32rpx;">
温馨提示
</view>
<block v-if="tispTile=='密码错误'">
<view class="">
{{tipsErr}}
</view>
<view class="" style="display: flex;">
<view style="width: 236rpx;height: 84rpx;margin-right:38rpx;">
<u-button plain text="找回密码" @tap="showTips=false,formItem=2"></u-button>
</view>
<view style="width: 236rpx;height: 84rpx;">
<u-button color="#46BF6F" text="重新输入" @tap="showTips=false"></u-button>
</view>
</view>
</block>
<block v-else-if="tispTile=='验证码错误'">
<view class="">
验证码错误请重新收入
</view>
<view class="" style="display: flex;">
<u-button color="#46BF6F" text="确定" @tap="showTips=false"></u-button>
</view>
</block>
<block v-else-if="tispTile=='密码不一致'">
<view class="">
两次输入的密码不一致请重新输入
</view>
<view class="" style="display: flex;">
<u-button color="#46BF6F" text="确定" @tap="showTips=false"></u-button>
</view>
</block>
<block v-else>
<view class="">
{{tispTile}}
</view>
<view class="" style="display: flex;width: 236rpx;">
<u-button color="#46BF6F" text="确定" @tap="showTips=false"></u-button>
</view>
</block>
</view>
</u-overlay>
<!-- tips结束 -->
</div>
</view>
</template> </template>
<script> <script>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
@ -312,9 +244,7 @@
getCaptcha, getCaptcha,
getAgreementApi, getAgreementApi,
appleLogin, appleLogin,
loginMpPhone, loginMpPhone
registerForget,
phonelogin
} from "@/api/user"; } from "@/api/user";
// #ifdef APP-PLUS // #ifdef APP-PLUS
import { import {
@ -351,12 +281,9 @@
mapGetters mapGetters
} from "vuex"; } from "vuex";
import Verify from '@/components/verify/verify.vue'; import Verify from '@/components/verify/verify.vue';
import { import { Toast } from "../../../libs/uniApi";
Toast
} from "../../../libs/uniApi";
const BACK_URL = "login_back_url"; const BACK_URL = "login_back_url";
// #ifdef APP-PLUS // #ifdef APP-PLUS
import oneClickStyle from "./oneClickStyle.js"
var jpushModule = uni.requireNativePlugin("JG-JPush"); var jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif // #endif
export default { export default {
@ -368,17 +295,10 @@
}, },
data: function() { data: function() {
return { return {
type1: true,
type2: true,
type3: true,
tipsErr: "",
tispTile: '密码错误',
showTips: false,
navList: ["快速登录","账号登录"], navList: ["快速登录","账号登录"],
current: 0, current: 0,
account: "", account: "",
password: "", password: "",
confirm_pwd: "",
captcha: "", captcha: "",
// #ifdef APP-PLUS // #ifdef APP-PLUS
formItem: 0, formItem: 0,
@ -413,8 +333,6 @@
formItem: function(nval, oVal) { formItem: function(nval, oVal) {
if (nval == 1) { if (nval == 1) {
this.type = 'login' this.type = 'login'
} else if (nval == 2) {
this.type = 'change_pwd'
} else { } else {
this.type = 'register' this.type = 'register'
} }
@ -449,18 +367,9 @@
// #endif // #endif
}, },
methods: { methods: {
showTipsFn(text, err) {
this.showTips = true
this.tispTile = text
this.tipsErr = err || ''
},
navgo(url) {
uni.navigateTo({
url
})
},
// #ifdef MP // #ifdef MP
getPhoneNumber(e) { getPhoneNumber(e) {
let that = this; let that = this;
loginMpPhone({ loginMpPhone({
iv: e.detail.iv, iv: e.detail.iv,
@ -470,8 +379,7 @@
}).then(({ }).then(({
data data
}) => { }) => {
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index";
"/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", {
@ -590,8 +498,7 @@
}).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) || const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index";
"/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", {
@ -684,8 +591,7 @@
}).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) || const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index";
"/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", {
@ -742,8 +648,7 @@
console.log('--', res); console.log('--', 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) || const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index";
"/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", {
@ -806,7 +711,6 @@
}); });
}); });
}, },
//
async loginMobile() { async loginMobile() {
let that = this; let that = this;
if (!that.account) return that.$util.Tips({ if (!that.account) return that.$util.Tips({
@ -841,8 +745,7 @@
data data
}) => { }) => {
this.checkOpenId(data.user) this.checkOpenId(data.user)
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index";
"/pages/index/index";
that.$store.commit("LOGIN", { that.$store.commit("LOGIN", {
'token': data.token, 'token': data.token,
'time': data.exp 'time': data.exp
@ -880,7 +783,9 @@
}); });
}) })
.catch(res => { .catch(res => {
that.showTipsFn(res) that.$util.Tips({
title: res
});
}); });
}, },
async register() { async register() {
@ -926,8 +831,7 @@
}); });
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) || const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index";
"/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
@ -948,90 +852,6 @@
}); });
}) })
.catch(res => { .catch(res => {
console.log(res, 'res')
that.showTipsFn('密码错误', res)
});
},
async weixinMerge() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请输入手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
title: '请输入验证码'
});
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
title: '请输入正确的验证码'
});
if (!that.password) return that.$util.Tips({
title: '请输入密码'
});
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({
title: '请输入6-16位字母加数字组合'
});
if (!that.isAgree) return that.$util.Tips({
title: '请勾选用户协议与隐私政策'
});
console.log('绑定前', {
auth_token: this.auth_token || uni.getStorageSync('auth_token'),
phone: that.account,
sms_code: that.captcha,
pwd: that.password,
spread: that.$Cache.get("spread"),
// #ifdef APP-PLUS
user_type: 'app',
// #endif
// #ifdef H5
user_type: 'h5',
// #endif
});
userMerge({
auth_token: this.auth_token || uni.getStorageSync('auth_token'),
phone: that.account,
sms_code: that.captcha,
pwd: that.password,
spread: that.$Cache.get("spread"),
// #ifdef APP-PLUS
user_type: 'app',
// #endif
// #ifdef H5
user_type: 'h5',
// #endif
})
.then(res => {
console.log(res);
that.$store.commit("LOGIN", {
'token': res.data.token,
'time': res.data.exp
});
that.$store.commit("SETUID", res.data.user.uid);
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";
that.$Cache.clear(BACK_URL);
that.$Cache.clear('login_back_url_weixin');
let method
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
'/pages/goods_cate/goods_cate',
'/pages/user/index'
]
if (indexPat.includes(this.getPath(backUrl))) {
method = 'switchTab'
} else {
method = 'navigateTo'
}
uni[method]({
url: backUrl,
success: () => {
this.auth_token = ''
}
});
})
.catch(res => {
console.log('error', err);
that.$util.Tips({ that.$util.Tips({
title: res title: res
}); });
@ -1094,8 +914,7 @@
}); });
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) || const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index";
"/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
@ -1133,7 +952,7 @@
// if (that.formItem == 2) that.type = "register"; // if (that.formItem == 2) that.type = "register";
await registerVerify({ await registerVerify({
phone: that.account, phone: that.account,
type: that.type, type: 'login',
key: that.keyCode, key: that.keyCode,
// code: that.codeVal, // code: that.codeVal,
toke: data.token, toke: data.token,
@ -1152,38 +971,6 @@
}); });
}); });
}, },
async registerReset() {
var that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (that.password == '123456') return that.$util.Tips({
title: '您输入的密码过于简单'
});
if (that.password != that.confirm_pwd) return that.$util.Tips({
title: '两次密码不一致'
});
if (!that.captcha) return that.$util.Tips({
title: '请填写验证码'
});
registerForget({
phone: that.account,
sms_code: that.captcha,
pwd: that.password,
confirm_pwd: that.confirm_pwd
})
.then(res => {
that.submitSuccess(res.data)
})
.catch(res => {
that.$util.Tips({
title: res
})
});
},
getcaptcha() { getcaptcha() {
let that = this let that = this
getCaptcha().then(data => { getCaptcha().then(data => {
@ -1202,8 +989,6 @@
} }
return url return url
}, },
//
async submit() { async submit() {
let that = this; let that = this;
if (!that.account) return that.$util.Tips({ if (!that.account) return that.$util.Tips({
@ -1218,31 +1003,17 @@
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
}) => { }) => {
this.submitSuccess(data)
})
.catch(e => {
that.showTipsFn("密码错误", e)
});
},
//
submitSuccess(data) {
console.log(data, 'hanshu')
let that = this
this.checkOpenId(data.user) this.checkOpenId(data.user)
let backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index";
"/pages/index/index";
that.$store.commit("LOGIN", { that.$store.commit("LOGIN", {
'token': data.token, 'token': data.token,
'time': data.exp 'time': data.exp
@ -1264,9 +1035,6 @@
'/pages/goods_cate/goods_cate', '/pages/goods_cate/goods_cate',
'/pages/user/index' '/pages/user/index'
] ]
// #ifdef H5
backUrl = backUrl.replace('/h5', '')
// #endif
if (indexPat.includes(this.getPath(backUrl))) { if (indexPat.includes(this.getPath(backUrl))) {
method = 'switchTab' method = 'switchTab'
} else { } else {
@ -1282,8 +1050,13 @@
uni[method]({ uni[method]({
url: backUrl url: backUrl
}); });
})
.catch(e => {
that.$util.Tips({
title: e
});
});
}, },
getVersion() { getVersion() {
getVersion().then(data => { getVersion().then(data => {
this.copyright = data.data; this.copyright = data.data;
@ -1355,66 +1128,13 @@
}) })
// #endif // #endif
},
// app
appOneClcik() {
let that = this
uni.preLogin({
provider: 'univerify',
success() {
console.log("当前环境支持一键登录")
uni.login({
provider: 'univerify',
univerifyStyle: oneClickStyle,
success(res) {
console.log(res, 'res')
phonelogin({
access_token: res.authResult.access_token,
openid: res.authResult.openid,
auth_token: that.auth_token,
user_type: 'app'
}).then(res => {
uni.closeAuthView()
that.submitSuccess(res.data)
}).catch(err => {
uni.closeAuthView()
that.$util.Tips({
title: '登录失败,请稍后再试'
});
})
// uniCloud.callFunction({
// name: 'oneClickLoginFn',
// data: {
// 'access_token': res.authResult
// .access_token,
// 'openid': res.authResult.openid
// }
// }).then(res => {
// console.log(res, 'res')
// }).catch(err => {
// console.log(err, 'ererre')
// })
},
fail(res) { //
console.log(res.errCode)
console.log(res.errMsg)
} }
})
},
fail(res) {
that.$util.Tips({
title: '当前环境不支持一键登录'
});
}
})
}
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background-color: white !important; background-color: #fff !important;
} }
/deep/uni-checkbox .uni-checkbox-input { /deep/uni-checkbox .uni-checkbox-input {
@ -1795,62 +1515,4 @@
font-size: 20rpx; font-size: 20rpx;
} }
} }
.footer-btns {
position: absolute;
bottom: 100rpx;
left: 50%;
transform: translate(-50%);
display: flex;
justify-content: space-between;
width: 750rpx !important;
padding: 0 112rpx;
.login-type-btn {
padding: 12rpx 30rpx;
border-radius: 32rpx;
background-color: #F6F6F6
}
.actLoginType {
color: #20B128;
background-color: #E8F7E9;
}
}
.footer-btn {
display: flex;
background-color: white;
width: 750rpx !important;
padding: 0 112rpx 50rpx 112rpx;
margin-top: 30rpx 0 30rpx 0;
.login-type-btn {
padding: 12rpx 30rpx;
border-radius: 32rpx;
background-color: #F6F6F6
}
.actLoginType {
color: #20B128;
background-color: #E8F7E9;
}
}
.tips {
width: 590rpx;
height: 354rpx;
background-color: white;
border-radius: 16rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
padding: 50rpx 40rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
</style> </style>

View File

@ -1,69 +0,0 @@
let customStyle = {
"fullScreen": true, // 是否全屏显示,默认值: false
"backgroundColor": "#ffffff", // 授权页面背景颜色,默认值:#ffffff
"backgroundImage": "", // 全屏显示的背景图片,默认值:"" (仅支持本地图片,只有全屏显示时支持)
"icon": {
"path": "static/xxx.png", // 自定义显示在授权框中的logo仅支持本地图片 默认显示App logo
"width": "60px", //图标宽度 默认值60px
"height": "60px" //图标高度 默认值60px
},
"closeIcon": {
"path": "static/xxx.png", // 自定义显示在授权框中的logo仅支持本地图片 默认显示App logo
"width": "60px", //图标宽度 默认值60px (HBuilderX 4.0支持)
"height": "60px" //图标高度 默认值60px (HBuilderX 4.0支持)
},
"phoneNum": {
"color": "#202020" // 手机号文字颜色 默认值:#202020
},
"slogan": {
"color": "#BBBBBB" // slogan 字体颜色 默认值:#BBBBBB
},
"authButton": {
"normalColor": "#3CB625", // 授权按钮正常状态背景颜色 默认值:#3479f5
"highlightColor": "#2861c5", // 授权按钮按下状态背景颜色 默认值:#2861c5仅ios支持
"disabledColor": "#73aaf5", // 授权按钮不可点击时背景颜色 默认值:#73aaf5仅ios支持
"textColor": "#ffffff", // 授权按钮文字颜色 默认值:#ffffff
"title": "本机号码一键登录", // 授权按钮文案 默认值:“本机号码一键登录”
"borderRadius": "24px" // 授权按钮圆角 默认值:"24px" (按钮高度的一半)
},
"otherLoginButton": {
"visible": true, // 是否显示其他登录按钮默认值true
"normalColor": "", // 其他登录按钮正常状态背景颜色 默认值:透明
"highlightColor": "", // 其他登录按钮按下状态背景颜色 默认值:透明
"textColor": "#656565", // 其他登录按钮文字颜色 默认值:#656565
"title": "其他登录方式", // 其他登录方式按钮文字 默认值:“其他登录方式”
"borderColor": "", //边框颜色 默认值透明仅iOS支持
"borderRadius": "0px" // 其他登录按钮圆角 默认值:"24px" (按钮高度的一半)
},
"privacyTerms": {
"defaultCheckBoxState": true, // 条款勾选框初始状态 默认值: true
"isCenterHint": false, //未勾选服务条款时点击登录按钮的提示是否居中显示 默认值: false (3.7.13+ 版本支持)
"uncheckedImage": "", // 可选 条款勾选框未选中状态图片(仅支持本地图片 建议尺寸 24x24px(3.2.0+ 版本支持)
"checkedImage": "", // 可选 条款勾选框选中状态图片(仅支持本地图片 建议尺寸24x24px(3.2.0+ 版本支持)
"checkBoxSize": 12, // 可选 条款勾选框大小
"textColor": "#BBBBBB", // 文字颜色 默认值:#BBBBBB
"termsColor": "#5496E3", // 协议文字颜色 默认值: #5496E3
"prefix": "我已阅读并同意", // 条款前的文案 默认值:“我已阅读并同意”
"suffix": "并使用本机号码登录", // 条款后的文案 默认值:“并使用本机号码登录”
"privacyItems": [ // 自定义协议条款最大支持2个需要同时设置url和title. 否则不生效
{
"url": "https://", // 点击跳转的协议详情页面
"title": "用户服务协议" // 协议名称
}
]
},
"buttons": { // 自定义页面下方按钮仅全屏模式生效3.1.14+ 版本支持)
"iconWidth": "45px", // 图标宽度(高度等比例缩放) 默认值45px
"list": [{
"provider": "apple",
"iconPath": "/static/apple.png" // 图标路径仅支持本地图片
},
{
"provider": "weixin",
"iconPath": "/static/wechat.png" // 图标路径仅支持本地图片
}
]
}
}
export default customStyle

View File

@ -1457,7 +1457,7 @@
title: res.message, title: res.message,
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 4,
url: goPages url: goPages
}); });
}).catch(res => { }).catch(res => {
@ -1486,7 +1486,7 @@
title: '支付成功', title: '支付成功',
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 4,
url: url url: url
}); });
}, },
@ -1496,7 +1496,7 @@
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付', title: '取消支付',
}, { }, {
tab: 5, tab: 4,
url: url url: url
}); });
}, },
@ -1506,7 +1506,7 @@
return that.$util.Tips({ return that.$util.Tips({
title: '', title: '',
}, { }, {
tab: 5, tab: 4,
url: url url: url
}); });
}, },

View File

@ -9,9 +9,8 @@
<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_info.mer_settlement_agree_status==1)||sale_type==2" <view v-if="mer_info.mer_settlement_agree_status||sale_type==2" class="tab_item"
class="tab_item" :class="{'tab_item_active': sale_type==2}" @click="changeSaleType(2)">商户订单 :class="{'tab_item_active': sale_type==2}" @click="changeSaleType(2)">商户订单</view>
</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>
@ -20,28 +19,23 @@
<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'>{{(sale_type==1?orderData.all:orderData.mer_all) || 0}}</view> <view class='num'>{{orderData.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'>{{(sale_type==1?orderData.noPay:orderData.mer_noPay) || 0}}</view> <view class='num'>{{orderData.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'>{{(sale_type==1?orderData.noPostage:orderData.mer_noPostage) || 0}}</view> <view class='num'>{{orderData.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' v-if="sale_type == 1">{{(Number(orderData.noDeliver)) || 0}} </view> <view class='num '>{{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'>{{(sale_type==1?orderData.noComment:orderData.mer_noComment) || 0}}</view> <view class='num'>{{orderData.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>
@ -79,12 +73,10 @@
<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" <navigator class="search acea-row row-middle" :url="`/pages/users/order_list/search?sale_type=${sale_type}`" 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)`}">
@ -110,19 +102,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 v-for="(order,j) in item.orderList" :key="order.order_id+j">
<view class='title acea-row row-between-wrapper'> <view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper"> <view class="acea-row row-middle left-wrapper">
<text class="iconfont icon-shangjiadingdan"></text> <text class="iconfont icon-shangjiadingdan"></text>
<view class="store-name line1">{{order.merchant.mer_name}} <view class="store-name">
<view>{{item.orderList[0].merchant.mer_name}}</view>
</view> </view>
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</view> </view>
<view class='t-color'> <view class='t-color'>
{{ order.activity_type === 2 && order.orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }} {{ item.orderList[0].activity_type === 2 && item.orderList[0].orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}
</view> </view>
</view> </view>
<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">
@ -215,73 +207,6 @@
</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">
@ -289,8 +214,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 line1"> <view class="store-name">
{{item.merchant.mer_name}} <view>{{item.merchant.mer_name}}</view>
</view> </view>
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</view> </view>
@ -420,7 +345,7 @@
</view> </view>
<!-- <home></home> --> <!-- <home></home> -->
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" <payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id"
:totalPrice='totalPrice' :sale_type="sale_type"></payment> :totalPrice='totalPrice'></payment>
<addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing> <addInvoicing ref="addInvoicing" @changeInvoiceClose="changeInvoiceClose" :invoice='invoice'></addInvoicing>
@ -478,9 +403,7 @@
groupOrderList, groupOrderList,
orderTake, orderTake,
applyInvoiceApi, applyInvoiceApi,
uploadEnvidenceApi, uploadEnvidenceApi
refundListNew,
refundDel
} from '@/api/order.js'; } from '@/api/order.js';
import { import {
getUserInfo getUserInfo
@ -576,12 +499,6 @@
add: false, add: false,
}, },
mer_info: {}, mer_info: {},
refundParam: {
page: 1,
limit: 15,
type: 0,
identity: ''
}
}; };
}, },
computed: { computed: {
@ -592,22 +509,23 @@
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(options); this.getUserInfo();
this.getpreSellOrderList(); this.getpreSellOrderList();
} else { } else {
toLogin() toLogin()
} }
if (options.sale_type) {
this.sale_type = options.sale_type
}
}, },
onShow() {
},
onReady: function() { onReady: function() {
// #ifdef H5 // #ifdef H5
this.$nextTick(() => { this.$nextTick(() => {
@ -622,25 +540,8 @@
}); });
// #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({
@ -668,8 +569,29 @@
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) {
@ -692,34 +614,24 @@
* 获取用户信息 * 获取用户信息
* *
*/ */
getUserInfo: function(options) { getUserInfo: function() {
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, options); if (res.data.mer_info) that.initMerInfo(res.data.mer_info);
}); });
}, },
/**
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({
@ -728,8 +640,10 @@
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({
@ -751,8 +665,10 @@
}); });
}); });
}, },
/**
// * 打开支付组件
*
*/
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;
@ -778,7 +694,10 @@
}); });
}, },
// /**
* 支付成功回调
*
*/
pay_complete: function() { pay_complete: function() {
this.loadend = false; this.loadend = false;
this.page = 1; this.page = 1;
@ -788,14 +707,17 @@
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({
@ -809,13 +731,11 @@
uni.hideLoading(); uni.hideLoading();
if (self.orderStatus == 0) { if (self.orderStatus == 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/order_details/stay?order_id=' + order_id + '&sale_type=' + url: '/pages/order_details/stay?order_id=' + order_id + '&sale_type=' + this.sale_type
this.sale_type
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id + '&sale_type=' + url: '/pages/order_details/index?order_id=' + order_id + '&sale_type=' + this.sale_type
this.sale_type
}) })
} }
}).catch(() => { }).catch(() => {
@ -834,8 +754,9 @@
} }
// #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({
@ -864,105 +785,21 @@
} }
// #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', []);
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(); this.getOrderList();
}
}, },
/**
changeSaleType(type = 1) { * 获取订单列表
if (this.sale_type == type) return; */
this.loadend = false;
this.loading = false;
this.orderList = [];
this.sale_type = type;
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();
}
},
// 退
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;
@ -988,8 +825,7 @@
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({
@ -1009,7 +845,6 @@
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 = "加载更多";
@ -1017,8 +852,9 @@
} }
} }
}, },
/**
// * 获取定金预售订单列表
*/
getpreSellOrderList: function() { getpreSellOrderList: function() {
let that = this; let that = this;
getOrderList({ getOrderList({
@ -1032,8 +868,9 @@
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) => {
@ -1047,8 +884,9 @@
}) })
} }
}, },
/**
// * 删除订单
*/
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 => {
@ -1066,7 +904,6 @@
}); });
}) })
}, },
// //
confirmOrder: function(item, index) { confirmOrder: function(item, index) {
let that = this; let that = this;
@ -1092,7 +929,6 @@
} }
}) })
}, },
/*申请开票*/ /*申请开票*/
applyInvoice(order_id) { applyInvoice(order_id) {
let that = this; let that = this;
@ -1102,13 +938,11 @@
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
@ -1124,138 +958,12 @@
} }
}, },
onReachBottom: function() { onReachBottom: function() {
if (this.orderStatus == 4)
this.getRefundList()
else
this.getOrderList(); 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;
@ -1384,7 +1092,6 @@
} }
.store-name { .store-name {
max-width: 400rpx;
margin: 0 10rpx; margin: 0 10rpx;
} }

View File

@ -4,8 +4,7 @@
<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" <input v-model="store_name" :focus="focus" confirm-type="search" placeholder="搜索我的订单" class="input" inputmode="search" @confirm="handleSearch" />
inputmode="search" @confirm="handleSearch" />
</view> </view>
</view> </view>
<view class='list'> <view class='list'>
@ -18,9 +17,7 @@
<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'> <view class='t-color'>{{ item.orderList[0].activity_type === 2 && item.orderList[0].orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}</view>
{{ 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">
<!--预售--> <!--预售-->
@ -28,36 +25,28 @@
<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 <image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.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 <text class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</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 <text v-if="goods.cart_info.productPresell.presell_type === 1">
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 <text v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</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>{{goods.cart_info.productPresellAttr.presell_price}}</view>
</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" <view v-if="goods.cart_info.productPresell.presell_type === 2" class="event_price">
class="event_price">
定金待支付 <text class="t-color">{{ order.pay_price }}</text> 定金待支付 <text class="t-color">{{ order.pay_price }}</text>
尾款待支付 <text 尾款待支付 <text class="t-color">{{ order.presellOrder.pay_price }}</text>
class="t-color">{{ order.presellOrder.pay_price }}</text>
</view> </view>
</view> </view>
</block> </block>
@ -67,18 +56,14 @@
<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 <image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.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 line2'>{{goods.cart_info.product.store_name}} <view class='name line2'>{{goods.cart_info.product.store_name}}</view>
</view>
<view class='money' v-if="item.orderList[0].activity_type == 4"> <view class='money' v-if="item.orderList[0].activity_type == 4">
<view v-if="goods.cart_info.activeSku"> <view v-if="goods.cart_info.activeSku">{{goods.cart_info.activeSku.active_price}}</view>
{{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'>
@ -90,83 +75,16 @@
</block> </block>
</view> </view>
</view> </view>
<view class='totalPrice' v-if="item.orderList[0].activity_type !== 2"> <view class='totalPrice' v-if="item.orderList[0].activity_type !== 2">{{item.total_num || 0}}件商品总金额
{{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 class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>立即付款</view>
立即付款</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">
@ -174,9 +92,7 @@
<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 line1" style="max-width: 500rpx;"> <view class="store-name">{{item.merchant.mer_name}}</view>
{{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>
@ -186,30 +102,22 @@
<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' <view class='item-info acea-row row-between row-top' v-for="(goods,index) in item.orderProduct" :key="index">
v-for="(goods,index) in item.orderProduct" :key="index">
<view class='pictrue'> <view class='pictrue'>
<image <image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.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 <text class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</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 <text v-if="goods.cart_info.productPresell.presell_type === 1">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</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 <text v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</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"> <view style="margin-top: 10rpx;" class="t-color">{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}</view>
{{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>
@ -219,30 +127,23 @@
</view> </view>
</view> </view>
<view v-else> <view v-else>
<view class='item-info acea-row row-between row-top' <view class='item-info acea-row row-between row-top' v-for="(goods,index) in item.orderProduct" :key="index">
v-for="(goods,index) in item.orderProduct" :key="index">
<view class='pictrue'> <view class='pictrue'>
<image <image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.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"> <view style="margin-top: 10rpx;" class="t-color">{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}</view>
{{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"> <view v-if="goods.cart_info.productAssistAttr">{{goods.cart_info.productAssistAttr.assist_price}}</view>
{{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"> <view v-if="goods.cart_info.activeSku">{{goods.cart_info.activeSku.active_price}}</view>
{{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>
@ -265,28 +166,19 @@
<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' <view class='bnt cancelBnt' v-if="item.delivery_type == 1 || item.delivery_type == 2" @click='goOrderDetails(item.order_id)'>查看物流</view>
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" <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">
: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 class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>去评价</view>
</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)' <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>
v-if="item.activity_type == 2 || item.activity_type == 3 || item.activity_type == 10"> <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">
查看详情</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>
@ -305,8 +197,7 @@
</view> </view>
</view> </view>
<home></home> <home></home>
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" <payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment>
:totalPrice='totalPrice'></payment>
</view> </view>
</template> </template>
@ -328,27 +219,16 @@
orderDel, orderDel,
orderPay, orderPay,
groupOrderList, groupOrderList,
orderTake, orderTake
refundListNew
} from '@/api/order.js'; } from '@/api/order.js';
import { import { getUserInfo } from '@/api/user.js';
getUserInfo import { openOrderSubscribe } from '@/utils/SubscribeMessage.js';
} 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 { import { mapGetters } from "vuex";
mapGetters
} from "vuex";
import emptyPage from '@/components/emptyPage.vue' import emptyPage from '@/components/emptyPage.vue'
import { import { configMap } from '@/utils'
configMap import { toLogin } from '@/libs/login.js';
} from '@/utils'
import {
toLogin
} from '@/libs/login.js';
export default { export default {
components: { components: {
payment, payment,
@ -396,15 +276,7 @@
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: {
@ -422,7 +294,6 @@
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) {
@ -433,6 +304,10 @@
toLogin() toLogin()
} }
}, },
onReady(){
},
mounted: function() {
},
methods: { methods: {
// //
goMall(item){ goMall(item){
@ -609,62 +484,18 @@
} }
// #endif // #endif
}, },
/**
// 退 * 切换类型
getRefundList() { */
let that = this; statusClick: function(status) {
if (that.loadend) return; if (status == this.orderStatus) return;
if (that.loading) return; this.orderStatus = status;
that.loading = true; this.loadend = false;
that.loadTitle = "加载更多"; this.loading = false;
refundListNew(this.refundParams).then(res => { this.page = 1;
let list = res.data.list || []; this.$set(this, 'orderList', []);
let loadend = list.length < that.limit; this.getOrderList();
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('用户点击取消');
}
}
});
},
/** /**
* 获取订单列表 * 获取订单列表
*/ */
@ -696,7 +527,22 @@
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);
})
},
/** /**
* 获取单个订单商品数量 * 获取单个订单商品数量
*/ */
@ -713,7 +559,26 @@
}) })
} }
}, },
/**
* 删除订单
*/
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;
@ -741,7 +606,7 @@
}, },
handleSearch() { handleSearch() {
this.loadend = false; this.loadend = false;
this.loading = false; this.page = 1;
this.orderList = []; this.orderList = [];
if (!this.store_name) { if (!this.store_name) {
return this.$util.Tips({ return this.$util.Tips({
@ -749,23 +614,10 @@
}); });
return; return;
} }
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(); this.getOrderList();
} }
}
}, },
onReachBottom: function() { onReachBottom: function() {
if (this.orderStatus == 4)
this.getRefundList()
else
this.getOrderList(); this.getOrderList();
}, },
@ -773,172 +625,34 @@
</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);}
.t-color { .p-color{color: var(--view-priceColor);}
color: var(--view-theme); .b-color{background-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;
@ -946,34 +660,28 @@
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;
@ -985,60 +693,49 @@
.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;
@ -1049,20 +746,16 @@
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;
@ -1070,12 +763,10 @@
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;
@ -1096,39 +787,32 @@
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="$u.throttle(bindComfirm, 1000)">申请退款</view> <view class="btn-box" @click="bindComfirm">申请退款</view>
<alertBox :msg="msg" v-if="isShowBox" @bindClose="bindClose"></alertBox> <alertBox :msg="msg" v-if="isShowBox" @bindClose="bindClose"></alertBox>
</view> </view>
</template> </template>

View File

@ -16,8 +16,8 @@
<block v-if="type == 2"> <block v-if="type == 2">
<view class="txt">请等待商家收货并退款</view> <view class="txt">请等待商家收货并退款</view>
<view class="time">还剩 <view class="time">还剩
<countDown :is-day="true" :tip-text="' '" :day-text="'天'" :hour-text="':'" :minute-text="':'" <countDown :is-day="true" :tip-text="' '" :day-text="'天'" :hour-text="':'" :minute-text="':'" :second-text="' '"
:second-text="' '" :datatime="datatime"></countDown> :datatime="datatime"></countDown>
</view> </view>
</block> </block>
<block v-if="type == 3"> <block v-if="type == 3">
@ -59,17 +59,12 @@
<view class="title">退款信息</view> <view class="title">退款信息</view>
<view class="product-box"> <view class="product-box">
<view class="product-item" v-for="(item,index) in detail.refundProduct" :key="index"> <view class="product-item" v-for="(item,index) in detail.refundProduct" :key="index">
<image class="img-box" :src="item.product.cart_info.productAttr.image" mode="" <image class="img-box" :src="item.product.cart_info.productAttr.image" mode="" v-if="item.product.cart_info.productAttr.image"></image>
v-if="item.product.cart_info.productAttr.image"></image>
<image class="img-box" :src="item.product.cart_info.product.image" mode="" v-else></image> <image class="img-box" :src="item.product.cart_info.product.image" mode="" v-else></image>
<view class="msg"> <view class="msg">
<view class="name line1"><text v-if="item.product.cart_info.product_type === 2" <view class="name line1"><text v-if="item.product.cart_info.product_type === 2" class="event_name event_bg">预售</text>{{item.product.cart_info.product.store_name}}</view>
class="event_name event_bg">预售</text>{{item.product.cart_info.product.store_name}}
</view>
<view class="des">{{item.product.cart_info.productAttr.sku}}</view> <view class="des">{{item.product.cart_info.productAttr.sku}}</view>
<view class="price"> <view class="price">{{item.product.product_type == 3 ? item.product.cart_info.productAssistAttr.assist_price : item.product.product_type == 4 ? item.product.cart_info.activeSku.active_price : item.product.cart_info.productAttr.price}}</view>
{{item.product.product_type == 3 ? item.product.cart_info.productAssistAttr.assist_price : item.product.product_type == 4 ? item.product.cart_info.activeSku.active_price : item.product.cart_info.productAttr.price}}
</view>
<view class="num">x {{item.refund_num}}</view> <view class="num">x {{item.refund_num}}</view>
</view> </view>
</view> </view>
@ -100,13 +95,6 @@
<text>{{detail.refund_num}}</text> <text>{{detail.refund_num}}</text>
</view> </view>
</view> </view>
<view class="item">
<view class="label">退款原因</view>
<view class="txt flex">
<text>{{ getRightText(detail.refund_message) }}</text>
</view>
</view>
<view class="item"> <view class="item">
<view class="label">申请时间</view> <view class="label">申请时间</view>
<view class="txt flex"> <view class="txt flex">
@ -160,15 +148,10 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { import { refundDetail, refundCancelApi } from '@/api/order.js'
refundDetail,
refundCancelApi
} from '@/api/order.js'
import ClipboardJS from "@/plugin/clipboard/clipboard.js"; import ClipboardJS from "@/plugin/clipboard/clipboard.js";
import countDown from '@/components/countDown' import countDown from '@/components/countDown'
import { import { mapGetters } from "vuex";
mapGetters
} from "vuex";
export default{ export default{
components: { components: {
countDown, countDown,
@ -186,7 +169,7 @@
}, },
onLoad(options) { onLoad(options) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '退款详情'   title:'退款详情'
}) })
this.refund_order_id = options.id this.refund_order_id = options.id
this.getDetail() this.getDetail()
@ -204,14 +187,6 @@
// #endif // #endif
}, },
methods:{ methods:{
getRightText(str) {
const index = str.indexOf("@");
if (index !== -1) {
return str.substring(0, index);
} else {
return str
}
},
// //
call: function(service){ call: function(service){
let that = this; let that = this;
@ -318,20 +293,16 @@
color: #fff; color: #fff;
background-color: #666666; background-color: #666666;
font-size: 30rpx; font-size: 30rpx;
.txt{ .txt{
font-weight: bold; font-weight: bold;
} }
.time{ .time{
margin-top: 10rpx; margin-top: 10rpx;
font-size: 24rpx; font-size: 24rpx;
opacity: .8; opacity: .8;
.time{ .time{
display: inline-block; display: inline-block;
width: 600rpx; width: 600rpx;
/deep/ .red{ /deep/ .red{
color: #fff; color: #fff;
} }
@ -342,25 +313,21 @@
.info-box{ .info-box{
margin-top: 12rpx; margin-top: 12rpx;
background-color: #fff; background-color: #fff;
.title{ .title{
padding: 0 32rpx; padding: 0 32rpx;
line-height: 86rpx; line-height: 86rpx;
border-bottom: 1px solid #F0F0F0; border-bottom: 1px solid #F0F0F0;
color: #282828; color: #282828;
} }
.product-box{ .product-box{
.product-item{ .product-item{
display: flex; display: flex;
padding: 25rpx 30rpx; padding: 25rpx 30rpx;
.img-box{ .img-box{
width:130rpx; width:130rpx;
height:130rpx; height:130rpx;
border-radius:16rpx; border-radius:16rpx;
} }
.msg{ .msg{
position: relative; position: relative;
display: flex; display: flex;
@ -368,22 +335,18 @@
justify-content: space-between; justify-content: space-between;
width: 440rpx; width: 440rpx;
margin-left: 26rpx; margin-left: 26rpx;
.name{ .name{
font-size: 28rpx; font-size: 28rpx;
color: #282828; color: #282828;
} }
.des{ .des{
font-size: 20rpx; font-size: 20rpx;
color: #868686; color: #868686;
} }
.price{ .price{
font-size: 26rpx; font-size: 26rpx;
color: var(--view-priceColor); color: var(--view-priceColor);
} }
.num{ .num{
position: absolute; position: absolute;
right: -80rpx; right: -80rpx;
@ -393,7 +356,6 @@
} }
} }
} }
.event_name{ .event_name{
display: inline-block; display: inline-block;
margin-right: 9rpx; margin-right: 9rpx;
@ -409,23 +371,19 @@
.event_bg{ .event_bg{
background: #FF7F00; background: #FF7F00;
} }
.store-info{ .store-info{
padding: 30rpx; padding: 30rpx;
.des{ .des{
margin-top: 10rpx; margin-top: 10rpx;
font-size: 26rpx; font-size: 26rpx;
color: #868686; color: #868686;
} }
.red-txt{ .red-txt{
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 10rpx; margin-top: 10rpx;
color: $theme-color; color: $theme-color;
font-size: 24rpx; font-size: 24rpx;
.iconfont{ .iconfont{
font-size: 30rpx; font-size: 30rpx;
margin-right: 5rpx; margin-right: 5rpx;
@ -434,24 +392,20 @@
} }
} }
} }
.content{ .content{
margin-top: 12rpx; margin-top: 12rpx;
padding: 30rpx 30rpx 0; padding: 30rpx 30rpx 0;
background-color: #FFFFFF; background-color: #FFFFFF;
.item{ .item{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 30rpx; margin-bottom: 30rpx;
.txt{ .txt{
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
width: 450rpx; width: 450rpx;
color: #868686; color: #868686;
text-align: right; text-align: right;
.copy{ .copy{
display: flex; display: flex;
align-items: center; align-items: center;
@ -465,27 +419,22 @@
color: #333; color: #333;
} }
} }
&:last-child{ &:last-child{
margin-bottom: 0; margin-bottom: 0;
} }
.upload-img{ .upload-img{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 20rpx; margin-top: 20rpx;
.img-item{ .img-item{
position: relative; position: relative;
width: 156rpx; width: 156rpx;
height: 156rpx; height: 156rpx;
margin-right: 23rpx; margin-right: 23rpx;
margin-top: 20rpx; margin-top: 20rpx;
&:nth-child(4n){ &:nth-child(4n){
margin-right: 0; margin-right: 0;
} }
image{ image{
width: 156rpx; width: 156rpx;
height: 156rpx; height: 156rpx;
@ -494,18 +443,15 @@
} }
} }
} }
.btn-wrapper{ .btn-wrapper{
position: relative; position: relative;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
height: 100rpx; height: 100rpx;
button{ button{
font-size: 28rpx; font-size: 28rpx;
} }
.btn{ .btn{
width:176rpx; width:176rpx;
height:60rpx; height:60rpx;
@ -517,13 +463,11 @@
border-radius:30rpx; border-radius:30rpx;
color: #fff; color: #fff;
} }
.gray{ .gray{
background: transparent; background: transparent;
border: 1px solid #eee; border: 1px solid #eee;
color: #AAAAAA; color: #AAAAAA;
} }
&:after{ &:after{
content:' '; content:' ';
position: absolute; position: absolute;
@ -536,14 +480,12 @@
} }
} }
} }
.box{ .box{
margin-top: 12rpx; margin-top: 12rpx;
padding:25rpx 30rpx; padding:25rpx 30rpx;
background-color: #fff; background-color: #fff;
font-size: 30rpx; font-size: 30rpx;
color: #282828; color: #282828;
.des{ .des{
margin-top: 5rpx; margin-top: 5rpx;
font-size: 26rpx; font-size: 26rpx;
@ -551,7 +493,6 @@
} }
} }
} }
/deep/.styleAll{ /deep/.styleAll{
color: #fff; color: #fff;
} }

View File

@ -5,42 +5,35 @@
<image :src="login_logo" v-if="login_logo" /> <image :src="login_logo" v-if="login_logo" />
</view> </view>
</view> --> </view> -->
<view class="whiteBg" style="margin: 0;width: 100%;padding: 50rpx 60rpx;" <view class="whiteBg" style="margin: 0;width: 100%;padding: 50rpx 60rpx;" :style="{ 'background-image': `url(${domain}/static/images/logo_bgl.png)`}">
:style="{ 'background-image': `url(${domain}/static/images/logo_bgl.png)`}">
<view class="login_title"> <view class="login_title">
<view class="title_h">找回密码</view> <view class="title_h">找回密码</view>
</view> </view>
<form class="list"> <form class="list">
<view class="item"> <view class="item">
<input type="number" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" <input type="number" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" autocomplete="off" />
autocomplete="off" />
<!-- <input type="text" style="height: 0;opacity: 0"> --> <!-- <input type="text" style="height: 0;opacity: 0"> -->
</view> </view>
<view class="item"> <view class="item">
<input type="password" placeholder="填写您的新密码" placeholder-class="placeholder" v-model="password" <input type="password" placeholder="填写您的新密码" placeholder-class="placeholder" v-model="password" autocomplete="off" />
autocomplete="off" />
</view> </view>
<view class="item"> <view class="item">
<input type="password" placeholder="再次输入新密码" placeholder-class="placeholder" v-model="confirm_pwd" <input type="password" placeholder="再次输入新密码" placeholder-class="placeholder" v-model="confirm_pwd" autocomplete="off" />
autocomplete="off" />
</view> </view>
<view class="item" style="display: flex;justify-content: space-between;"> <view class="item" style="display: flex;justify-content: space-between;">
<input type="number" placeholder="填写验证码" maxlength="4" placeholder-class="placeholder" <input type="number" placeholder="填写验证码" maxlength="4" placeholder-class="placeholder" class="codeIput" v-model="captcha" autocomplete="off" />
class="codeIput" v-model="captcha" autocomplete="off" /> <button class="code" style="color: #fff;" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="handleVerify">
<button class="code" style="color: #fff;" :disabled="disabled"
:class="disabled === true ? 'on' : ''" @click="handleVerify">
{{ text }} {{ text }}
</button> </button>
</view> </view>
</form> </form>
<view class="logon" @click="registerReset">确认</view> <view class="logon" @click="registerReset">确认</view>
<!-- <view class="tip"> <view class="tip">
<text @click="back">立即登录</text> <text @click="back">立即登录</text>
</view> --> </view>
</view> </view>
<view class="bottom"></view> <view class="bottom"></view>
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" <Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
ref="verify"></Verify>
</view> </view>
</template> </template>
@ -55,9 +48,7 @@
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
const app = getApp(); const app = getApp();
import { import { mapGetters} from "vuex";
mapGetters
} from "vuex";
import sendVerifyCode from "@/mixins/SendVerifyCode"; import sendVerifyCode from "@/mixins/SendVerifyCode";
import { import {
registerVerify, registerVerify,
@ -65,20 +56,14 @@
getCodeApi, getCodeApi,
getCaptcha getCaptcha
} from "@/api/user"; } from "@/api/user";
import { import { validatorDefaultCatch } from "@/utils/dialog";
validatorDefaultCatch
} from "@/utils/dialog";
import attrs, { import attrs, {
required, required,
alpha_num, alpha_num,
chs_phone chs_phone
} from "@/utils/validate"; } from "@/utils/validate";
import { import { configMap } from '@/utils';
configMap import { HTTP_REQUEST_URL } from '@/config/app';
} from '@/utils';
import {
HTTP_REQUEST_URL
} from '@/config/app';
import Verify from '@/components/verify/verify.vue'; import Verify from '@/components/verify/verify.vue';
export default { export default {
name: "RetrievePassword", name: "RetrievePassword",
@ -100,8 +85,10 @@
}; };
}, },
computed: configMap(['login_logo'], mapGetters(['viewColor'])), computed: configMap(['login_logo'], mapGetters(['viewColor'])),
onReady() {}, onReady() {
mounted: function() {}, },
mounted: function() {
},
methods: { methods: {
back() { back() {
uni.navigateBack(); uni.navigateBack();
@ -197,11 +184,9 @@
background: #ffffff; background: #ffffff;
height: 100vh; height: 100vh;
} }
.register .list .item .code { .register .list .item .code {
color: var(--view-theme); color: var(--view-theme);
} }
.whiteBg .logon { .whiteBg .logon {
display: flex; display: flex;
align-items: center; align-items: center;
@ -214,7 +199,6 @@
color: #FFFFFF; color: #FFFFFF;
font-size: 30rpx; font-size: 30rpx;
} }
.whiteBg{ .whiteBg{
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% auto; background-size: 100% auto;

View File

@ -42,9 +42,7 @@
userOut, userOut,
getLogout getLogout
} from '@/api/user.js' } from '@/api/user.js'
import { import { mapGetters } from "vuex";
mapGetters
} from "vuex";
export default { export default {
name: 'user_about', name: 'user_about',
data() { data() {
@ -88,13 +86,9 @@
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: res.message, content: res.message,
success: ({ success: ({confirm}) => {
confirm
}) => {
if (confirm) { if (confirm) {
userOut({ userOut({key: res.data.result.key}).then(res => {
key: res.data.result.key
}).then(res => {
uni.hideLoading() uni.hideLoading()
if(res.data.status === 200){ if(res.data.status === 200){
call() call()
@ -187,23 +181,19 @@
padding: 30rpx; padding: 30rpx;
color: #282828; color: #282828;
} }
.cancelTxt { .cancelTxt {
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
image{ image{
max-width: 100%; max-width: 100%;
} }
} }
.cancel { .cancel {
position: fixed; position: fixed;
bottom: 60rpx; bottom: 60rpx;
left: 0; left: 0;
z-index: 1; z-index: 1;
width: 100%; width: 100%;
.checkbox { .checkbox {
display: flex; display: flex;
align-items: center; align-items: center;
@ -211,26 +201,21 @@
margin: 0 auto; margin: 0 auto;
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
span { span {
margin-left: 5rpx; margin-left: 5rpx;
} }
.font { .font {
color: var(--view-theme); color: var(--view-theme);
font-style: normal; font-style: normal;
} }
.iconfont { .iconfont {
font-size: 28rpx; font-size: 28rpx;
margin-right: 15rpx; margin-right: 15rpx;
} }
.icon-xuanzhong1{ .icon-xuanzhong1{
color: var(--view-theme); color: var(--view-theme);
} }
} }
.btn { .btn {
width: 690rpx; width: 690rpx;
height: 90rpx; height: 90rpx;
@ -246,7 +231,6 @@
} }
} }
} }
.outMoal { .outMoal {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -258,7 +242,6 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.box { .box {
position: fixed; position: fixed;
width: 590rpx; width: 590rpx;
@ -268,18 +251,15 @@
border-radius: 20rpx; border-radius: 20rpx;
text-align: center; text-align: center;
padding: 50rpx; padding: 50rpx;
.title { .title {
font-size: 30rpx; font-size: 30rpx;
font-weight: 600; font-weight: 600;
color: #282828; color: #282828;
} }
.moalBtn { .moalBtn {
margin-top: 43rpx; margin-top: 43rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.ok { .ok {
width: 234rpx; width: 234rpx;
height: 66rpx; height: 66rpx;
@ -289,7 +269,6 @@
line-height: 66rpx; line-height: 66rpx;
color: var(--view-theme); color: var(--view-theme);
} }
.no { .no {
width: 234rpx; width: 234rpx;
height: 66rpx; height: 66rpx;

View File

@ -1,97 +1,8 @@
<style lang="scss">
.sel_addr_wrap {
height: 120rpx;
padding: 30rpx 0;
.sel_addr {
display: flex;
align-items: center;
justify-content: center;
margin: 0 30rpx;
border: 2rpx solid #40ae36;
height: 60rpx;
line-height: 60rpx;
text-align: center;
color: #40ae36;
border-radius: 10rpx;
font-weight: bold;
&:active {
background: rgba(64, 174, 54, .1);
}
text {
margin-right: 10rpx;
}
}
}
.sel_addr_update-wrap {
padding: 30rpx 0;
.sel_addr_update {
display: flex;
align-items: center;
justify-content: space-between;
border: 2rpx solid #40ae36;
box-shadow: 0 0 2rpx 2rpx #40ae3650;
padding: 10rpx 20rpx;
margin: 0rpx 30rpx;
border-radius: 10rpx;
.sel_addr_wrap-l {
.sel_addr_wrap-l-addr {
margin-bottom: 8rpx;
font-size: 28rpx;
font-weight: bold;
color: #333;
max-width: 480rpx;
}
.sel_addr_wrap-l-detail {
font-size: 26rpx;
color: #999;
max-width: 480rpx;
}
}
.sel_addr_wrap-r {
padding: 8rpx 8rpx;
border: 2rpx solid #40ae36;
border-radius: 10rpx;
color: #40ae36;
}
}
}
</style>
<template> <template>
<view :style="viewColor"> <view :style="viewColor">
<form @submit="formSubmit" report-submit='true'> <form @submit="formSubmit" report-submit='true'>
<view class='addAddress'> <view class='addAddress'>
<view class='list'> <view class='list'>
<view v-if="userAddress.detail != ''" class="sel_addr_update-wrap">
<view class="sel_addr_update">
<view class="sel_addr_wrap-l">
<view class="sel_addr_wrap-l-addr line1">{{userAddress.detail}}</view>
<view class="sel_addr_wrap-l-detail line1">{{userAddress.address_detail}}</view>
</view>
<view class="sel_addr_wrap-r" @click="handleToChoose">修改地址</view>
</view>
</view>
<view v-else class="sel_addr_wrap">
<view class="sel_addr" @click="handleToChoose">
<text>选择收货地址</text>
<u-icon name="arrow-right" size="16" color="#40ae36"></u-icon>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>门牌号</view>
<input type='text' class="location-input" placeholder='详细地址,例:1栋101号' name='house_number'
placeholder-class='placeholder' v-model="userAddress.house_number"></input>
</view>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view class='name'>姓名</view> <view class='name'>姓名</view>
<input type='text' placeholder='请输入姓名' name='real_name' :value="userAddress.real_name" <input type='text' placeholder='请输入姓名' name='real_name' :value="userAddress.real_name"
@ -102,19 +13,40 @@
<input type='text' placeholder='请输入联系电话' name="phone" :value='userAddress.phone' <input type='text' placeholder='请输入联系电话' name="phone" :value='userAddress.phone'
placeholder-class='placeholder'></input> placeholder-class='placeholder'></input>
</view> </view>
<!-- <view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view class='name'>所在地区</view> <view class='name'>所在地区</view>
<view class="region"> <view class="region">
<view class="region_count" @click="handleToChoose"> <view class="region_count" @click="changeRegion">
<text v-if="!detail.length" style="color:#cdcdcd;">请选择地区</text> <text v-if="!addressInfo.length" style="color:#cdcdcd;">请选择地区</text>
<text v-else>{{detail}}</text> <text v-else>{{addressText}}</text>
<text class="iconfont icon-xiangyou"></text>
</view>
</view>
</view>
<!-- <view class='item acea-row row-between-wrapper'>
<view class='name'>所在村队</view>
<view class="region">
<view class="region_count" @click="changevillage">
<text v-if="!villageInfo.length" style="color:#cdcdcd;">请选择村队</text>
<text v-else>{{villageText}}</text>
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</view> </view>
</view> </view>
</view> --> </view> -->
<view class='item acea-row row-between-wrapper'>
<view class='name'>详细地址</view>
<input type='text' class="location-input" placeholder='请填写具体地址' name='detail'
placeholder-class='placeholder' v-model="userAddress.detail"></input>
<!--<view class="location" @click="selfLocation">
<text class="iconfont icon-chakanditu"></text>
<br>
定位
</view> -->
</view> </view>
</view>
<view class='default acea-row row-middle'> <view class='default acea-row row-middle'>
<checkbox-group @change='ChangeIsDefault'> <checkbox-group @change='ChangeIsDefault'>
<checkbox :checked="userAddress.is_default ? true : false" />设置为默认地址 <checkbox :checked="userAddress.is_default ? true : false" />设置为默认地址
@ -154,9 +86,7 @@
editAddress, editAddress,
getAddressDetail getAddressDetail
} from '@/api/user.js'; } from '@/api/user.js';
import { import { wgsToGcj } from "@/utils/wgs.js";
wgsToGcj
} from "@/utils/wgs.js";
import { import {
getCityV2, getCityV2,
getCityList getCityList
@ -183,8 +113,7 @@
couponId: 0, //id couponId: 0, //id
address_id: 0, //id address_id: 0, //id
userAddress: { userAddress: {
is_default: false, is_default: false
detail: ''
}, // }, //
region: ['省', '市', '区'], region: ['省', '市', '区'],
valueRegion: [0, 0, 0], valueRegion: [0, 0, 0],
@ -197,15 +126,10 @@
display: false, display: false,
display_one: false, display_one: false,
addressInfo: [], addressInfo: [],
newAddrInfo: '',
newPCAS: '',
villageInfo: [], villageInfo: [],
list: [], list: [],
latitude: '', latitude: '',
longitude: '', longitude: ''
detail: '', //15
location: '', //
}; };
}, },
computed: { computed: {
@ -234,39 +158,14 @@
} }
}, },
methods: { methods: {
//
handleToChoose() {
let that = this;
// #ifdef H5
uni.navigateTo({
url: "/pages/select_address_n/select_address_n",
success: (res) => {
uni.$once('changeAddress', res => {
console.log(res)
// this.newAddrInfo = res.addr; "name": ",,,",
that.detail = res.addr.address;
that.location = res.addr.location;
})
}
})
// #endif
// #ifndef H5
uni.chooseLocation({
success: function(res) {
that.userAddress.detail = res.name
that.userAddress.address_detail = res.address;
that.location = `${res.latitude},${res.longitude}`;;
}
});
// #endif
},
OnChangeAddress(address) { OnChangeAddress(address) {
this.addressInfo = address; this.addressInfo = address;
this.list = address this.list = address
}, },
OnChangevAddress(address) {
this.villageInfo = address;
console.log(this.villageInfo)
},
// //
getCityList: function() { getCityList: function() {
let that = this; let that = this;
@ -309,9 +208,9 @@
let region = [res.data.province, res.data.city, res.data.district, res.data.street, res let region = [res.data.province, res.data.city, res.data.district, res.data.street, res
.data.village .data.village
]; ];
console.log({...res.data});
that.$set(that, 'userAddress', res.data); that.$set(that, 'userAddress', res.data);
that.$set(that, 'region', region); that.$set(that, 'region', region);
that.$set(that, 'location', res.data.location);
that.city_id = res.data.city_id that.city_id = res.data.city_id
if(res.data.areas) that.addressInfo = res.data.areas; if(res.data.areas) that.addressInfo = res.data.areas;
else { else {
@ -445,10 +344,6 @@
formSubmit: function(e) { formSubmit: function(e) {
let that = this, let that = this,
value = e.detail.value; value = e.detail.value;
value.location = that.location
value.detail = that.userAddress.detail
value.address_detail = that.userAddress.address_detail
if (!value.real_name) return that.$util.Tips({ if (!value.real_name) return that.$util.Tips({
title: '请填写收货人姓名' title: '请填写收货人姓名'
}); });
@ -458,22 +353,19 @@
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({ if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({
title: '请输入正确的手机号码' title: '请输入正确的手机号码'
}); });
// if (!that.detail.length) return that.$util.Tips({ if (!that.addressInfo.length) return that.$util.Tips({
// title: '' title: '请选择所在地区'
// }); });
// if (!that.villageInfo.length) return that.$util.Tips({ // if (!that.villageInfo.length) return that.$util.Tips({
// title: '' // title: ''
// }); // });
if (!value.detail) return that.$util.Tips({ if (!value.detail) return that.$util.Tips({
title: '请填写详细地址' title: '请填写详细地址'
}); });
if (!value.location) return that.$util.Tips({
title: '请选择地址'
});
value.address_id = that.address_id; value.address_id = that.address_id;
value.is_default = that.userAddress.is_default ? 1 : 0; value.is_default = that.userAddress.is_default ? 1 : 0;
value.area = that.detail; value.area = that.addressInfo;
// value.brigade = that.villageInfo[0] value.brigade = that.villageInfo[0]
uni.showLoading({ uni.showLoading({
title: '保存中', title: '保存中',
@ -578,11 +470,8 @@
} }
.region .region_count { .region .region_count {
// height: 42rpx; height: 42rpx;
// line-height: 42rpx; line-height: 42rpx;
display: flex;
align-items: center;
justify-content: space-between;
.icon-xiangyou { .icon-xiangyou {
float: right; float: right;

View File

@ -677,11 +677,10 @@
width: 690rpx; width: 690rpx;
height: 90rpx; height: 90rpx;
border-radius: 45rpx; border-radius: 45rpx;
margin: 80rpx auto 40rpx auto; margin: 80rpx auto 0 auto;
color: var(--view-theme); color: var(--view-theme);
background-color: #ffffff; background-color: #ffffff;
border: 1px solid var(--view-theme); border: 1px solid var(--view-theme);
} }
.avatar-box { .avatar-box {

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -19,9 +19,7 @@ import {
import Cache from '../../utils/cache'; import Cache from '../../utils/cache';
// #ifdef APP-PLUS // #ifdef APP-PLUS
import Updater from '@/uni_modules/guyue-updater/index'; import Updater from '@/uni_modules/guyue-updater/index';
import { import { Toast } from "../../libs/uniApi.js";
Toast
} from "../../libs/uniApi.js";
// #endif // #endif
@ -30,16 +28,14 @@ const state = {
token: Cache.get(LOGIN_STATUS) || null, token: Cache.get(LOGIN_STATUS) || null,
uuid: uni.getStorageSync('uuid') || "", uuid: uni.getStorageSync('uuid') || "",
backgroundColor: "#fff", backgroundColor: "#fff",
userInfo: (typeof Cache.get('USER_INFO') == 'string' ? JSON.parse(Cache.get('USER_INFO')) : Cache.get( userInfo: (typeof Cache.get('USER_INFO') == 'string' ? JSON.parse(Cache.get('USER_INFO')) : Cache.get('USER_INFO'))||{},
'USER_INFO')) || {},
uid: Cache.get(UID) || null, uid: Cache.get(UID) || null,
globalData: uni.getStorageSync('GLOBAL_DATA') || {}, globalData: uni.getStorageSync('GLOBAL_DATA') || {},
homeActive: false, homeActive: false,
copyPwd: null, copyPwd: null,
pageFooter:uni.getStorageSync('pageFoot') || {}, pageFooter:uni.getStorageSync('pageFoot') || {},
keyColor: Cache.get('KEY_COLOR') || '_default', keyColor: Cache.get('KEY_COLOR') || '_default',
viewColor: Cache.get('VIEW_COLOR') || viewColor: Cache.get('VIEW_COLOR') || '--view-theme: #E93323;--view-assist:#FF7612;--view-priceColor:#E93323;--view-bgColor:rgba(255, 118, 18,.1);--view-minorColor:rgba(233, 51, 35,.1);--view-bntColor11:#FDA923;--view-bntColor12:#FD6523;--view-bntColor21:#F11B09;--view-bntColor22:#F67A38;',
'--view-theme: #E93323;--view-assist:#FF7612;--view-priceColor:#E93323;--view-bgColor:rgba(255, 118, 18,.1);--view-minorColor:rgba(233, 51, 35,.1);--view-bntColor11:#FDA923;--view-bntColor12:#FD6523;--view-bntColor21:#F11B09;--view-bntColor22:#F67A38;',
}; };
const mutations = { const mutations = {
@ -145,17 +141,17 @@ const actions = {
} else { } else {
apptype = 1 apptype = 1
} }
// console.log({ console.log({
// version: os.appWgtVersion, version: os.appWgtVersion,
// type: apptype, type: apptype,
// phone_brand:os.brand phone_brand:os.brand
// }); });
Appversion({ Appversion({
version: os.appWgtVersion, version: os.appWgtVersion,
type: apptype, type: apptype,
phone_brand:os.brand phone_brand:os.brand
}).then((res) => { }).then((res) => {
// console.log(res); console.log(res);
if(data) uni.hideLoading() if(data) uni.hideLoading()
if (Object.keys(res.data.appInfo).length > 0) { if (Object.keys(res.data.appInfo).length > 0) {
// if(res.data.appInfo.version) uni.showLoading({ // if(res.data.appInfo.version) uni.showLoading({
@ -180,7 +176,8 @@ const actions = {
Toast(e) Toast(e)
} }
// uni.hideLoading(); // uni.hideLoading();
} else { }
else {
if(data) Toast('已经是最新版本了') if(data) Toast('已经是最新版本了')
} }

View File

@ -15,7 +15,7 @@
/* 颜色变量 */ /* 颜色变量 */
/* 行为相关颜色 */ /* 行为相关颜色 */
$uni-color-primary: #20B128; $uni-color-primary: #007aff;
$uni-color-success: #4cd964; $uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e; $uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d; $uni-color-error: #dd524d;

View File

@ -1,35 +0,0 @@
// 下面仅展示客户端使用post方式发送content-type为application/json请求的场景
exports.main = async (event) => {
let body = event.body
if (event.isBase64Encoded) {
body = Buffer.from(body, 'base64')
}
const {
access_token,
openid
} = JSON.parse(body)
if (!access_token || !openid) {
return { // 不建议把完整手机号返回给前端
success: false,
error: {
code: 'params is not fund',
message: '参数错误',
}
}
}
const res = await uniCloud.getPhoneNumber({
provider: 'univerify',
appid: '__UNI__3A527D1', // DCloud appid不同于callFunction方式调用使用云函数Url化需要传递DCloud appid参数
access_token: access_token,
openid: openid
})
console.log(res); // res里包含手机号
return { // 不建议把完整手机号返回给前端
success: true,
info: {
code: 0,
message: '获取手机号成功',
data: res,
}
}
}

View File

@ -1,8 +0,0 @@
{
"name": "oneClickLoginFn",
"dependencies": {},
"extensions": {
"uni-cloud-jql": {},
"uni-cloud-verify": {}
}
}

View File

@ -1,12 +0,0 @@
// 本文件用于使用JQL语法操作项目关联的uniCloud空间的数据库方便开发调试和远程数据库管理
// 编写clientDB的js API也支持常规js语法比如var可以对云数据库进行增删改查操作。不支持uniCloud-db组件写法
// 可以全部运行也可以选中部分代码运行。点击工具栏上的运行按钮或者按下【F5】键运行代码
// 如果文档中存在多条JQL语句只有最后一条语句生效
// 如果混写了普通js最后一条语句需是数据库操作语句
// 此处代码运行不受DB Schema的权限控制移植代码到实际业务中注意在schema中配好permission
// 不支持clientDB的action
// 数据库查询有最大返回条数限制详见https://uniapp.dcloud.net.cn/uniCloud/cf-database.html#limit
// 详细JQL语法请参考https://uniapp.dcloud.net.cn/uniCloud/jql.html
// 下面示例查询uni-id-users表的所有数据
db.collection('uni-id-users').get();

View File

@ -1,6 +0,0 @@
## 0.0.32022-11-11
- 修复 config 方法获取根节点为数组格式配置时错误的转化为了对象的Bug
## 0.0.22021-04-16
- 修改插件package信息
## 0.0.12021-03-15
- 初始化项目

View File

@ -1,81 +0,0 @@
{
"id": "uni-config-center",
"displayName": "uni-config-center",
"version": "0.0.3",
"description": "uniCloud 配置中心",
"keywords": [
"配置",
"配置中心"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "",
"type": "unicloud-template-function"
},
"directories": {
"example": "../../../scripts/dist"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "u"
}
}
}
}
}

View File

@ -1,93 +0,0 @@
# 为什么使用uni-config-center
实际开发中很多插件需要配置文件才可以正常运行,如果每个插件都单独进行配置的话就会产生下面这样的目录结构
```bash
cloudfunctions
└─────common 公共模块
├─plugin-a // 插件A对应的目录
│ ├─index.js
│ ├─config.json // plugin-a对应的配置文件
│ └─other-file.cert // plugin-a依赖的其他文件
└─plugin-b // plugin-b对应的目录
├─index.js
└─config.json // plugin-b对应的配置文件
```
假设插件作者要发布一个项目模板,里面使用了很多需要配置的插件,无论是作者发布还是用户使用都是一个大麻烦。
uni-config-center就是用了统一管理这些配置文件的使用uni-config-center后的目录结构如下
```bash
cloudfunctions
└─────common 公共模块
├─plugin-a // 插件A对应的目录
│ └─index.js
├─plugin-b // plugin-b对应的目录
│ └─index.js
└─uni-config-center
├─index.js // config-center入口文件
├─plugin-a
│ ├─config.json // plugin-a对应的配置文件
│ └─other-file.cert // plugin-a依赖的其他文件
└─plugin-b
└─config.json // plugin-b对应的配置文件
```
使用uni-config-center后的优势
- 配置文件统一管理,分离插件主体和配置信息,更新插件更方便
- 支持对config.json设置schema插件使用者在HBuilderX内编写config.json文件时会有更好的提示后续HBuilderX会提供支持
# 用法
在要使用uni-config-center的公共模块或云函数内引入uni-config-center依赖请参考[使用公共模块](https://uniapp.dcloud.net.cn/uniCloud/cf-common)
```js
const createConfig = require('uni-config-center')
const uniIdConfig = createConfig({
pluginId: 'uni-id', // 插件id
defaultConfig: { // 默认配置
tokenExpiresIn: 7200,
tokenExpiresThreshold: 600,
},
customMerge: function(defaultConfig, userConfig) { // 自定义默认配置和用户配置的合并规则,不设置的情况侠会对默认配置和用户配置进行深度合并
// defaudltConfig 默认配置
// userConfig 用户配置
return Object.assign(defaultConfig, userConfig)
}
})
// 以如下配置为例
// {
// "tokenExpiresIn": 7200,
// "passwordErrorLimit": 6,
// "bindTokenToDevice": false,
// "passwordErrorRetryTime": 3600,
// "app-plus": {
// "tokenExpiresIn": 2592000
// },
// "service": {
// "sms": {
// "codeExpiresIn": 300
// }
// }
// }
// 获取配置
uniIdConfig.config() // 获取全部配置注意uni-config-center内不存在对应插件目录时会返回空对象
uniIdConfig.config('tokenExpiresIn') // 指定键值获取配置返回7200
uniIdConfig.config('service.sms.codeExpiresIn') // 指定键值获取配置返回300
uniIdConfig.config('tokenExpiresThreshold', 600) // 指定键值获取配置如果不存在则取传入的默认值返回600
// 获取文件绝对路径
uniIdConfig.resolve('custom-token.js') // 获取uni-config-center/uni-id/custom-token.js文件的路径
// 引用文件require
uniIDConfig.requireFile('custom-token.js') // 使用require方式引用uni-config-center/uni-id/custom-token.js文件。文件不存在时返回undefined文件内有其他错误导致require失败时会抛出错误。
// 判断是否包含某文件
uniIDConfig.hasFile('custom-token.js') // 配置目录是否包含某文件true: 文件存在false: 文件不存在
```

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"name":"uni-config-center","version":"0.0.3","description":"配置中心","main":"index.js","keywords":[],"author":"DCloud","license":"Apache-2.0"}

View File

@ -1,34 +0,0 @@
## 1.0.172024-04-26
- 兼容uni-app-x对客户端uniPlatform的调整uni-app-x内uniPlatform区分app-android、app-ios
## 1.0.162023-04-25
- 新增maxTokenLength配置用于限制数据库用户记录token数组的最大长度
## 1.0.152023-04-06
- 修复部分语言国际化出错的Bug
## 1.0.142023-03-07
- 修复 admin用户包含其他角色时未包含在token的Bug
## 1.0.132022-07-21
- 修复 创建token时未传角色权限信息生成的token不正确的bug
## 1.0.122022-07-15
- 提升与旧版本uni-id的兼容性补充读取配置文件时回退平台app-plus、h5但是仍推荐使用新平台名进行配置app、web
## 1.0.112022-07-14
- 修复 部分情况下报`read property 'reduce' of undefined`的错误
## 1.0.102022-07-11
- 将token存储在用户表的token字段内与旧版本uni-id保持一致
## 1.0.92022-07-01
- checkToken兼容token内未缓存角色权限的情况此时将查库获取角色权限
## 1.0.82022-07-01
- 修复clientDB默认依赖时部分情况下获取不到uni-id配置的Bug
## 1.0.72022-06-30
- 修复config文件不合法时未抛出具体错误的Bug
## 1.0.62022-06-28
- 移除插件内的数据表schema
## 1.0.52022-06-27
- 修复使用多应用配置时报`Cannot read property 'appId' of undefined`的Bug
## 1.0.42022-06-27
- 修复使用自定义token内容功能报错的Bug [详情](https://ask.dcloud.net.cn/question/147945)
## 1.0.22022-06-23
- 对齐旧版本uni-id默认配置
## 1.0.12022-06-22
- 补充对uni-config-center的依赖
## 1.0.02022-06-21
- 提供uni-id token创建、校验、刷新接口简化旧版uni-id公共模块

View File

@ -1,85 +0,0 @@
{
"id": "uni-id-common",
"displayName": "uni-id-common",
"version": "1.0.17",
"description": "包含uni-id token生成、校验、刷新功能的云函数公共模块",
"keywords": [
"uni-id-common",
"uniCloud",
"token",
"权限"
],
"repository": "https://gitcode.net/dcloud/uni-id-common",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "",
"type": "unicloud-template-function"
},
"uni_modules": {
"dependencies": ["uni-config-center"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@ -1,3 +0,0 @@
# uni-id-common
文档请参考:[uni-id-common](https://uniapp.dcloud.net.cn/uniCloud/uni-id-common.html)

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"name":"uni-id-common","version":"1.0.17","description":"uni-id token生成、校验、刷新","main":"index.js","homepage":"https://uniapp.dcloud.io/uniCloud/uni-id-common.html","repository":{"type":"git","url":"git+https://gitee.com/dcloud/uni-id-common.git"},"author":"DCloud","license":"Apache-2.0","dependencies":{"uni-config-center":"file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"}}

View File

@ -1,26 +0,0 @@
'use strict';
class BridgeError extends Error {
constructor(code, message) {
super(message)
this._code = code
}
get code() {
return this._code
}
get errCode() {
return this._code
}
get errMsg() {
return this.message
}
}
module.exports = {
BridgeError
}

View File

@ -1,124 +0,0 @@
'use strict';
const {
ProviderType
} = require('./consts.js')
const configCenter = require('uni-config-center')
// 多维数据为兼容uni-id以前版本配置
const OauthConfig = {
'weixin-app': [
['app', 'oauth', 'weixin'],
['app-plus', 'oauth', 'weixin']
],
'weixin-mp': [
['mp-weixin', 'oauth', 'weixin']
],
'weixin-h5': [
['web', 'oauth', 'weixin-h5'],
['h5-weixin', 'oauth', 'weixin'],
['h5', 'oauth', 'weixin']
],
'weixin-web': [
['web', 'oauth', 'weixin-web']
],
'qq-app': [
['app', 'oauth', 'qq'],
['app-plus', 'oauth', 'qq']
],
'qq-mp': [
['mp-qq', 'oauth', 'qq']
]
}
const Support_Platforms = [
ProviderType.WEIXIN_MP,
ProviderType.WEIXIN_H5,
ProviderType.WEIXIN_APP,
ProviderType.WEIXIN_WEB,
ProviderType.QQ_MP,
ProviderType.QQ_APP
]
class ConfigBase {
constructor() {
const uniIdConfigCenter = configCenter({
pluginId: 'uni-id'
})
this._uniIdConfig = uniIdConfigCenter.config()
}
getAppConfig(appid) {
if (Array.isArray(this._uniIdConfig)) {
return this._uniIdConfig.find((item) => {
return (item.dcloudAppid === appid)
})
}
return this._uniIdConfig
}
}
class AppConfig extends ConfigBase {
constructor() {
super()
}
get(appid, platform) {
if (!this.isSupport(platform)) {
return null
}
let appConfig = this.getAppConfig(appid)
if (!appConfig) {
return null
}
return this.getOauthConfig(appConfig, platform)
}
isSupport(platformName) {
return (Support_Platforms.indexOf(platformName) >= 0)
}
getOauthConfig(appConfig, platformName) {
let treePath = OauthConfig[platformName]
let node = this.findNode(appConfig, treePath)
if (node && node.appid && node.appsecret) {
return {
appid: node.appid,
secret: node.appsecret
}
}
return null
}
findNode(treeNode, arrayPath) {
let node = treeNode
for (let treePath of arrayPath) {
for (let name of treePath) {
const currentNode = node[name]
if (currentNode) {
node = currentNode
} else {
node = null
break
}
}
if (node === null) {
node = treeNode
} else {
break
}
}
return node
}
}
module.exports = {
AppConfig
};

View File

@ -1,30 +0,0 @@
'use strict';
const TAG = "UNI_OPEN_BRIDGE"
const HTTP_STATUS = {
SUCCESS: 200
}
const ProviderType = {
WEIXIN_MP: 'weixin-mp',
WEIXIN_H5: 'weixin-h5',
WEIXIN_APP: 'weixin-app',
WEIXIN_WEB: 'weixin-web',
QQ_MP: 'qq-mp',
QQ_APP: 'qq-app'
}
// old
const PlatformType = ProviderType
const ErrorCodeType = {
SYSTEM_ERROR: TAG + "_SYSTEM_ERROR"
}
module.exports = {
HTTP_STATUS,
ProviderType,
PlatformType,
ErrorCodeType
}

View File

@ -1,317 +0,0 @@
'use strict';
const {
PlatformType,
ProviderType,
ErrorCodeType
} = require('./consts.js')
const {
AppConfig
} = require('./config.js')
const {
Storage
} = require('./storage.js')
const {
BridgeError
} = require('./bridge-error.js')
const {
WeixinServer
} = require('./weixin-server.js')
const appConfig = new AppConfig()
class AccessToken extends Storage {
constructor() {
super('access-token', ['provider', 'appid'])
}
async update(key) {
super.update(key)
const result = await this.getByWeixinServer(key)
return this.set(key, result.value, result.duration)
}
async fallback(key) {
return this.getByWeixinServer(key)
}
async getByWeixinServer(key) {
const oauthConfig = appConfig.get(key.dcloudAppid, key.provider)
let methodName
if (key.provider === ProviderType.WEIXIN_MP) {
methodName = 'GetMPAccessTokenData'
} else if (key.provider === ProviderType.WEIXIN_H5) {
methodName = 'GetH5AccessTokenData'
} else {
throw new BridgeError(ErrorCodeType.SYSTEM_ERROR, "provider invalid")
}
const responseData = await WeixinServer[methodName](oauthConfig)
const duration = responseData.expires_in || (60 * 60 * 2)
delete responseData.expires_in
return {
value: responseData,
duration
}
}
}
class UserAccessToken extends Storage {
constructor() {
super('user-access-token', ['provider', 'appid', 'openid'])
}
}
class SessionKey extends Storage {
constructor() {
super('session-key', ['provider', 'appid', 'openid'])
}
}
class Encryptkey extends Storage {
constructor() {
super('encrypt-key', ['provider', 'appid', 'openid'])
}
async update(key) {
super.update(key)
const result = await this.getByWeixinServer(key)
return this.set(key, result.value, result.duration)
}
getKeyString(key) {
return `${super.getKeyString(key)}-${key.version}`
}
getExpiresIn(value) {
if (value <= 0) {
return 60
}
return value
}
async fallback(key) {
return this.getByWeixinServer(key)
}
async getByWeixinServer(key) {
const accessToken = await Factory.Get(AccessToken, key)
const userSession = await Factory.Get(SessionKey, key)
const responseData = await WeixinServer.GetUserEncryptKeyData({
openid: key.openid,
access_token: accessToken.access_token,
session_key: userSession.session_key
})
const keyInfo = responseData.key_info_list.find((item) => {
return item.version === key.version
})
if (!keyInfo) {
throw new BridgeError(ErrorCodeType.SYSTEM_ERROR, 'key version invalid')
}
const value = {
encrypt_key: keyInfo.encrypt_key,
iv: keyInfo.iv
}
return {
value,
duration: keyInfo.expire_in
}
}
}
class Ticket extends Storage {
constructor() {
super('ticket', ['provider', 'appid'])
}
async update(key) {
super.update(key)
const result = await this.getByWeixinServer(key)
return this.set(key, result.value, result.duration)
}
async fallback(key) {
return this.getByWeixinServer(key)
}
async getByWeixinServer(key) {
const accessToken = await Factory.Get(AccessToken, {
dcloudAppid: key.dcloudAppid,
provider: ProviderType.WEIXIN_H5
})
const responseData = await WeixinServer.GetH5TicketData(accessToken)
const duration = responseData.expires_in || (60 * 60 * 2)
delete responseData.expires_in
delete responseData.errcode
delete responseData.errmsg
return {
value: responseData,
duration
}
}
}
const Factory = {
async Get(T, key, fallback) {
Factory.FixOldKey(key)
return Factory.MakeUnique(T).get(key, fallback)
},
async Set(T, key, value, expiresIn) {
Factory.FixOldKey(key)
return Factory.MakeUnique(T).set(key, value, expiresIn)
},
async Remove(T, key) {
Factory.FixOldKey(key)
return Factory.MakeUnique(T).remove(key)
},
async Update(T, key) {
Factory.FixOldKey(key)
return Factory.MakeUnique(T).update(key)
},
FixOldKey(key) {
if (!key.provider) {
key.provider = key.platform
}
const configData = appConfig.get(key.dcloudAppid, key.provider)
if (!configData) {
throw new BridgeError(ErrorCodeType.SYSTEM_ERROR, 'appid or provider invalid')
}
key.appid = configData.appid
},
MakeUnique(T) {
return new T()
}
}
// exports
async function getAccessToken(key, fallback) {
return Factory.Get(AccessToken, key, fallback)
}
async function setAccessToken(key, value, expiresIn) {
return Factory.Set(AccessToken, key, value, expiresIn)
}
async function removeAccessToken(key) {
return Factory.Remove(AccessToken, key)
}
async function updateAccessToken(key) {
return Factory.Update(AccessToken, key)
}
async function getUserAccessToken(key, fallback) {
return Factory.Get(UserAccessToken, key, fallback)
}
async function setUserAccessToken(key, value, expiresIn) {
return Factory.Set(UserAccessToken, key, value, expiresIn)
}
async function removeUserAccessToken(key) {
return Factory.Remove(UserAccessToken, key)
}
async function getSessionKey(key, fallback) {
return Factory.Get(SessionKey, key, fallback)
}
async function setSessionKey(key, value, expiresIn) {
return Factory.Set(SessionKey, key, value, expiresIn)
}
async function removeSessionKey(key) {
return Factory.Remove(SessionKey, key)
}
async function getEncryptKey(key, fallback) {
return Factory.Get(Encryptkey, key, fallback)
}
async function setEncryptKey(key, value, expiresIn) {
return Factory.Set(Encryptkey, key, value, expiresIn)
}
async function removeEncryptKey(key) {
return Factory.Remove(Encryptkey, key)
}
async function updateEncryptKey(key) {
return Factory.Update(Encryptkey, key)
}
async function getTicket(key, fallback) {
return Factory.Get(Ticket, key, fallback)
}
async function setTicket(key, value, expiresIn) {
return Factory.Set(Ticket, key, value, expiresIn)
}
async function removeTicket(key) {
return Factory.Remove(Ticket, key)
}
async function updateTicket(key) {
return Factory.Update(Ticket, key)
}
module.exports = {
getAccessToken,
setAccessToken,
removeAccessToken,
updateAccessToken,
getUserAccessToken,
setUserAccessToken,
removeUserAccessToken,
getSessionKey,
setSessionKey,
removeSessionKey,
getEncryptKey,
setEncryptKey,
removeEncryptKey,
updateEncryptKey,
getTicket,
setTicket,
removeTicket,
updateTicket,
ProviderType,
PlatformType,
WeixinServer,
ErrorCodeType
}

View File

@ -1,15 +0,0 @@
{
"name": "uni-open-bridge-common",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}

View File

@ -1,111 +0,0 @@
'use strict';
const {
Validator
} = require('./validator.js')
const {
CacheKeyCascade
} = require('./uni-cloud-cache.js')
const {
BridgeError
} = require('./bridge-error.js')
class Storage {
constructor(type, keys) {
this._type = type || null
this._keys = keys || []
}
async get(key, fallback) {
this.validateKey(key)
const result = await this.create(key, fallback).get()
return result.value
}
async set(key, value, expiresIn) {
this.validateKey(key)
this.validateValue(value)
const expires_in = this.getExpiresIn(expiresIn)
if (expires_in !== 0) {
await this.create(key).set(this.getValue(value), expires_in)
}
}
async remove(key) {
this.validateKey(key)
await this.create(key).remove()
}
// virtual
async update(key) {
this.validateKey(key)
}
async ttl(key) {
this.validateKey(key)
// 后续考虑支持
}
async fallback(key) {}
getKeyString(key) {
const keyArray = [Storage.Prefix]
this._keys.forEach((name) => {
keyArray.push(key[name])
})
keyArray.push(this._type)
return keyArray.join(':')
}
getValue(value) {
return value
}
getExpiresIn(value) {
if (value !== undefined) {
return value
}
return -1
}
validateKey(key) {
Validator.Key(this._keys, key)
}
validateValue(value) {
Validator.Value(value)
}
create(key, fallback) {
const keyString = this.getKeyString(key)
const options = {
layers: [{
type: 'database',
key: keyString
}, {
type: 'redis',
key: keyString
}]
}
const _this = this
return new CacheKeyCascade({
...options,
fallback: async function() {
if (fallback) {
return fallback(key)
} else if (_this.fallback) {
return _this.fallback(key)
}
}
})
}
}
Storage.Prefix = "uni-id"
module.exports = {
Storage
};

View File

@ -1,324 +0,0 @@
const db = uniCloud.database()
function getType(value) {
return Object.prototype.toString.call(value).slice(8, -1).toLowerCase()
}
const validator = {
key: function(value) {
const err = new Error('Invalid key')
if (typeof value !== 'string') {
throw err
}
const valueTrim = value.trim()
if (!valueTrim || valueTrim !== value) {
throw err
}
},
value: function(value) {
// 仅作简单校验
const type = getType(value)
const validValueType = ['null', 'number', 'string', 'array', 'object']
if (validValueType.indexOf(type) === -1) {
throw new Error('Invalid value type')
}
},
duration: function(value) {
const err = new Error('Invalid duration')
if (value === undefined) {
return
}
if (typeof value !== 'number' || value === 0) {
throw err
}
}
}
/**
* 入库时 expired 为过期时间对应的时间戳永不过期用-1表示
* 返回结果时 与redis对齐-1表示永不过期-2表示已过期或不存在
*/
class DatabaseCache {
constructor({
collection = 'opendb-open-data'
} = {}) {
this.type = 'db'
this.collection = db.collection(collection)
}
_serializeValue(value) {
return value === undefined ? null : JSON.stringify(value)
}
_deserializeValue(value) {
return value ? JSON.parse(value) : value
}
async set(key, value, duration) {
validator.key(key)
validator.value(value)
validator.duration(duration)
value = this._serializeValue(value)
await this.collection.doc(key).set({
value,
expired: duration && duration !== -1 ? Date.now() + (duration * 1000) : -1
})
}
async _getWithDuration(key) {
const getKeyRes = await this.collection.doc(key).get()
const record = getKeyRes.data[0]
if (!record) {
return {
value: null,
duration: -2
}
}
const value = this._deserializeValue(record.value)
const expired = record.expired
if (expired === -1) {
return {
value,
duration: -1
}
}
const duration = expired - Date.now()
if (duration <= 0) {
await this.remove(key)
return {
value: null,
duration: -2
}
}
return {
value,
duration: Math.floor(duration / 1000)
}
}
async get(key, {
withDuration = true
} = {}) {
const result = await this._getWithDuration(key)
if (!withDuration) {
delete result.duration
}
return result
}
async remove(key) {
await this.collection.doc(key).remove()
}
}
class RedisCache {
constructor() {
this.type = 'redis'
this.redis = uniCloud.redis()
}
_serializeValue(value) {
return value === undefined ? null : JSON.stringify(value)
}
_deserializeValue(value) {
return value ? JSON.parse(value) : value
}
async set(key, value, duration) {
validator.key(key)
validator.value(value)
validator.duration(duration)
value = this._serializeValue(value)
if (!duration || duration === -1) {
await this.redis.set(key, value)
} else {
await this.redis.set(key, value, 'EX', duration)
}
}
async get(key, {
withDuration = false
} = {}) {
let value = await this.redis.get(key)
value = this._deserializeValue(value)
if (!withDuration) {
return {
value
}
}
const durationSecond = await this.redis.ttl(key)
let duration
switch (durationSecond) {
case -1:
duration = -1
break
case -2:
duration = -2
break
default:
duration = durationSecond
break
}
return {
value,
duration
}
}
async remove(key) {
await this.redis.del(key)
}
}
class Cache {
constructor({
type,
collection
} = {}) {
if (type === 'database') {
return new DatabaseCache({
collection
})
} else if (type === 'redis') {
return new RedisCache()
} else {
throw new Error('Invalid cache type')
}
}
}
class CacheKey {
constructor({
type,
collection,
cache,
key,
fallback
} = {}) {
this.cache = cache || new Cache({
type,
collection
})
this.key = key
this.fallback = fallback
}
async set(value, duration) {
await this.cache.set(this.key, value, duration)
}
async setWithSync(value, duration, syncMethod) {
await Promise.all([
this.set(this.key, value, duration),
syncMethod(value, duration)
])
}
async get() {
let {
value,
duration
} = await this.cache.get(this.key)
if (value !== null && value !== undefined) {
return {
value,
duration
}
}
if (!this.fallback) {
return {
value: null,
duration: -2
}
}
const fallbackResult = await this.fallback()
value = fallbackResult.value
duration = fallbackResult.duration
if (value !== null && duration !== undefined) {
await this.cache.set(this.key, value, duration)
}
return {
value,
duration
}
}
async remove() {
await this.cache.remove(this.key)
}
}
class CacheKeyCascade {
constructor({
layers, // [{cache, type, collection, key}] 从低级到高级排序,[DbCacheKey, RedisCacheKey]
fallback
} = {}) {
this.layers = layers
this.cacheLayers = []
let lastCacheKey
for (let i = 0; i < layers.length; i++) {
const {
type,
cache,
collection,
key
} = layers[i]
const lastCacheKeyTemp = lastCacheKey
try {
const currentCacheKey = new CacheKey({
type,
collection,
cache,
key,
fallback: i === 0 ? fallback : function() {
return lastCacheKeyTemp.get()
}
})
this.cacheLayers.push(currentCacheKey)
lastCacheKey = currentCacheKey
} catch (e) {}
}
this.highLevelCache = lastCacheKey
}
async set(value, duration) {
return Promise.all(
this.cacheLayers.map(item => {
return item.set(value, duration)
})
)
}
async setWithSync(value, duration, syncMethod) {
const setPromise = this.cacheLayers.map(item => {
return item.set(value, duration)
})
return Promise.all(
[
...setPromise,
syncMethod(value, duration)
]
)
}
async get() {
return this.highLevelCache.get()
}
async remove() {
await Promise.all(
this.cacheLayers.map(cacheKeyItem => {
return cacheKeyItem.remove()
})
)
}
}
module.exports = {
Cache,
DatabaseCache,
RedisCache,
CacheKey,
CacheKeyCascade
}

View File

@ -1,31 +0,0 @@
const Validator = {
Key(keyArray, parameters) {
for (let i = 0; i < keyArray.length; i++) {
const keyName = keyArray[i]
if (typeof parameters[keyName] !== 'string') {
Validator.ThrowNewError(`Invalid ${keyName}`)
}
if (parameters[keyName].length < 1) {
Validator.ThrowNewError(`Invalid ${keyName}`)
}
}
},
Value(value) {
if (value === undefined) {
Validator.ThrowNewError('Invalid Value')
}
if (typeof value !== 'object') {
Validator.ThrowNewError('Invalid Value Type')
}
},
ThrowNewError(message) {
throw new Error(message)
}
}
module.exports = {
Validator
}

View File

@ -1,203 +0,0 @@
'use strict';
const crypto = require('crypto')
const {
HTTP_STATUS
} = require('./consts.js')
const {
BridgeError
} = require('./bridge-error.js')
class WeixinServer {
constructor(options = {}) {
this._appid = options.appid
this._secret = options.secret
}
getAccessToken() {
return uniCloud.httpclient.request(WeixinServer.AccessToken_Url, {
dataType: 'json',
method: 'POST',
contentType: 'json',
data: {
appid: this._appid,
secret: this._secret,
grant_type: "client_credential"
}
})
}
// 使用客户端获取的 code 从微信服务器换取 openidcode 仅可使用一次
codeToSession(code) {
return uniCloud.httpclient.request(WeixinServer.Code2Session_Url, {
dataType: 'json',
data: {
appid: this._appid,
secret: this._secret,
js_code: code,
grant_type: 'authorization_code'
}
})
}
getUserEncryptKey({
access_token,
openid,
session_key
}) {
console.log(access_token, openid, session_key);
const signature = crypto.createHmac('sha256', session_key).update('').digest('hex')
return uniCloud.httpclient.request(WeixinServer.User_Encrypt_Key_Url, {
dataType: 'json',
method: 'POST',
dataAsQueryString: true,
data: {
access_token,
openid: openid,
signature: signature,
sig_method: 'hmac_sha256'
}
})
}
getH5AccessToken() {
return uniCloud.httpclient.request(WeixinServer.AccessToken_H5_Url, {
dataType: 'json',
method: 'GET',
data: {
appid: this._appid,
secret: this._secret,
grant_type: "client_credential"
}
})
}
getH5Ticket(access_token) {
return uniCloud.httpclient.request(WeixinServer.Ticket_Url, {
dataType: 'json',
dataAsQueryString: true,
method: 'POST',
data: {
access_token
}
})
}
getH5AccessTokenForEip() {
return uniCloud.httpProxyForEip.postForm(WeixinServer.AccessToken_H5_Url, {
appid: this._appid,
secret: this._secret,
grant_type: "client_credential"
}, {
dataType: 'json'
})
}
getH5TicketForEip(access_token) {
return uniCloud.httpProxyForEip.postForm(WeixinServer.Ticket_Url, {
access_token
}, {
dataType: 'json',
dataAsQueryString: true
})
}
}
WeixinServer.AccessToken_Url = 'https://api.weixin.qq.com/cgi-bin/stable_token'
WeixinServer.Code2Session_Url = 'https://api.weixin.qq.com/sns/jscode2session'
WeixinServer.User_Encrypt_Key_Url = 'https://api.weixin.qq.com/wxa/business/getuserencryptkey'
WeixinServer.AccessToken_H5_Url = 'https://api.weixin.qq.com/cgi-bin/token'
WeixinServer.Ticket_Url = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi'
WeixinServer.GetMPAccessToken = function(options) {
return new WeixinServer(options).getAccessToken()
}
WeixinServer.GetCodeToSession = function(options) {
return new WeixinServer(options).codeToSession(options.code)
}
WeixinServer.GetUserEncryptKey = function(options) {
return new WeixinServer(options).getUserEncryptKey(options)
}
WeixinServer.GetH5AccessToken = function(options) {
return new WeixinServer(options).getH5AccessToken()
}
WeixinServer.GetH5Ticket = function(options) {
return new WeixinServer(options).getH5Ticket(options.access_token)
}
////////////////////////////////////////////////////////////////
function isAliyun() {
return (uniCloud.getCloudInfos()[0].provider === 'aliyun')
}
WeixinServer.GetResponseData = function(response) {
console.log("WeixinServer::response", response)
if (!(response.status === HTTP_STATUS.SUCCESS || response.statusCodeValue === HTTP_STATUS.SUCCESS)) {
throw new BridgeError(response.status || response.statusCodeValue, response.status || response.statusCodeValue)
}
const responseData = response.data || response.body
if (responseData.errcode !== undefined && responseData.errcode !== 0) {
throw new BridgeError(responseData.errcode, responseData.errmsg)
}
return responseData
}
WeixinServer.GetMPAccessTokenData = async function(options) {
const response = await new WeixinServer(options).getAccessToken()
return WeixinServer.GetResponseData(response)
}
WeixinServer.GetCodeToSessionData = async function(options) {
const response = await new WeixinServer(options).codeToSession(options.code)
return WeixinServer.GetResponseData(response)
}
WeixinServer.GetUserEncryptKeyData = async function(options) {
const response = await new WeixinServer(options).getUserEncryptKey(options)
return WeixinServer.GetResponseData(response)
}
WeixinServer.GetH5AccessTokenData = async function(options) {
const ws = new WeixinServer(options)
let response
if (isAliyun()) {
response = await ws.getH5AccessTokenForEip()
if (typeof response === 'string') {
response = JSON.parse(response)
}
} else {
response = await ws.getH5AccessToken()
}
return WeixinServer.GetResponseData(response)
}
WeixinServer.GetH5TicketData = async function(options) {
const ws = new WeixinServer(options)
let response
if (isAliyun()) {
response = await ws.getH5TicketForEip(options.access_token)
if (typeof response === 'string') {
response = JSON.parse(response)
}
} else {
response = await ws.getH5Ticket(options.access_token)
}
return WeixinServer.GetResponseData(response)
}
module.exports = {
WeixinServer
}

View File

@ -1,29 +0,0 @@
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

@ -1,6 +1,3 @@
import {
Toast
} from "../libs/uniApi";
import { import {
getGXconfig, getGXconfig,
miniapp miniapp
@ -35,8 +32,11 @@ function compareVersions(version1, version2) {
const loadMP = async (id) => { const loadMP = async (id) => {
appid = id; appid = id;
let info = await getGXconfig(); let info = await getGXconfig();
console.log('最新版本', info.data);
// return ;
uni.$emit('showLoading', true, '初始化中'); uni.$emit('showLoading', true, '初始化中');
mp.getUniMPVersion(id, (ret) => { mp.getUniMPVersion(id, (ret) => {
console.log('当前版本', ret);
let flag; let flag;
if (ENV == 'prod') { if (ENV == 'prod') {
flag = false flag = false
@ -47,15 +47,14 @@ const loadMP = async (id) => {
true) { true) {
let count = 0; let count = 0;
timer = setInterval(() => { timer = setInterval(() => {
if (count < 100 && count > 0) uni.$emit('showLoading', true, if (count < 100 && count > 0) uni.$emit('showLoading', true, `初始化中... ${count}%`)
`初始化中... ${count}%`)
else uni.$emit('showLoading', true, `初始化中... 99%`) else uni.$emit('showLoading', true, `初始化中... 99%`)
}, 200) }, 200)
let downloadTask = uni.downloadFile({ let downloadTask = uni.downloadFile({
url: info.data.version_info?.dow_url, url: info.data.version_info?.dow_url,
// url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/36e40202405031202367449.wgt",
success(res) { success(res) {
wgtFile = res.tempFilePath; wgtFile = res.tempFilePath;
console.log('初始化完成', wgtFile);
setTimeout(()=>{ setTimeout(()=>{
installMP(); installMP();
clearInterval(timer); clearInterval(timer);
@ -104,13 +103,12 @@ const loadMPx = async (id) => {
true) { true) {
let count = 0; let count = 0;
timer = setInterval(() => { timer = setInterval(() => {
if (count < 100 && count > 0) uni.$emit('showLoading', true, if (count < 100 && count > 0) uni.$emit('showLoading', true, `初始化中... ${count}%`)
`初始化中... ${count}%`)
else uni.$emit('showLoading', true, `初始化中... 99%`) else uni.$emit('showLoading', true, `初始化中... 99%`)
}, 200) }, 200)
let downloadTask = uni.downloadFile({ let downloadTask = uni.downloadFile({
url: './__UNI__7626C0F.wgt', url: info.data.appInfo.dow_url,
success(res) { success(res) {
wgtFile = res.tempFilePath; wgtFile = res.tempFilePath;
console.log('初始化完成', wgtFile); console.log('初始化完成', wgtFile);
@ -127,6 +125,7 @@ const loadMPx = async (id) => {
} }
}); });
downloadTask.onProgressUpdate((res) => { downloadTask.onProgressUpdate((res) => {
// console.log('初始化进度' + res.progress);
if (res.progress > count) count += 10; if (res.progress > count) count += 10;
if (count >= 90) { if (count >= 90) {
clearInterval(timer); clearInterval(timer);
@ -156,13 +155,11 @@ const loadMPurl = async (e) => {
} else { } else {
flag = true flag = true
} }
if (0 != ret.code || compareVersions(fileInfo.data?.data?.version, ret if (0 != ret.code || compareVersions(fileInfo.data?.data?.version, ret.versionInfo.name) == 1 || flag ==
.versionInfo.name) == 1 || flag ==
true) { true) {
let count = 0; let count = 0;
timer = setInterval(() => { timer = setInterval(() => {
if (count < 100 && count > 0) uni.$emit('showLoading', true, if (count < 100 && count > 0) uni.$emit('showLoading', true, `初始化中... ${count}%`)
`初始化中... ${count}%`)
else uni.$emit('showLoading', true, `初始化中... 99%`) else uni.$emit('showLoading', true, `初始化中... 99%`)
}, 200) }, 200)
let downloadTask = uni.downloadFile({ let downloadTask = uni.downloadFile({
@ -205,8 +202,6 @@ const loadMPurl = async (e) => {
// 商城配置的小程序 // 商城配置的小程序
const loadAppletMP = async (data) => { const loadAppletMP = async (data) => {
// console.log(data)
// return
appid = data.app_id; appid = data.app_id;
// return ; // return ;
uni.$emit('showLoading', true, '初始化中'); uni.$emit('showLoading', true, '初始化中');
@ -217,30 +212,20 @@ const loadAppletMP = async (data) => {
} else { } else {
flag = true flag = true
} }
if (data.showToast) {
uni.showLoading({
title: '正在加载中...'
});
}
if (0 != ret.code || compareVersions(data.version, ret.versionInfo.name) == 1 || flag == if (0 != ret.code || compareVersions(data.version, ret.versionInfo.name) == 1 || flag ==
true) { true) {
let count = 0; let count = 0;
timer = setInterval(() => { timer = setInterval(() => {
if (count < 100 && count > 0) uni.$emit('showLoading', true, if (count < 100 && count > 0) uni.$emit('showLoading', true, `初始化中... ${count}%`)
`初始化中... ${count}%`)
else uni.$emit('showLoading', true, `初始化中... 99%`) else uni.$emit('showLoading', true, `初始化中... 99%`)
}, 200) }, 200)
let downloadTask = uni.downloadFile({ let downloadTask = uni.downloadFile({
url: data.url, url: data.url,
// url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/3ffde202405031254278460.wgt",
success(res) { success(res) {
wgtFile = res.tempFilePath; wgtFile = res.tempFilePath;
console.log('初始化完成', wgtFile); console.log('初始化完成', wgtFile);
setTimeout(()=>{ setTimeout(()=>{
installMP(data); installMP();
clearInterval(timer); clearInterval(timer);
timer = null; timer = null;
}, 700) }, 700)
@ -252,6 +237,7 @@ const loadAppletMP = async (data) => {
} }
}); });
downloadTask.onProgressUpdate((res) => { downloadTask.onProgressUpdate((res) => {
// console.log('初始化进度' + res.progress);
if (res.progress > count) count += 10; if (res.progress > count) count += 10;
if (count >= 90) { if (count >= 90) {
clearInterval(timer); clearInterval(timer);
@ -292,6 +278,7 @@ const loadMPdns = async (e) => {
} }
}); });
downloadTask.onProgressUpdate((res) => { downloadTask.onProgressUpdate((res) => {
// console.log('初始化进度' + res.progress);
if (res.progress > count) count += 10; if (res.progress > count) count += 10;
if (count >= 90) { if (count >= 90) {
clearInterval(timer); clearInterval(timer);
@ -311,19 +298,19 @@ const getVersion = (id) => {
}) })
} }
// 初始化小程序 // 初始化小程序
const installMP = (data) => { const installMP = () => {
mp.getUniMPVersion(appid, (ret) => { mp.getUniMPVersion(appid, (ret) => {
doInstallMP(data); doInstallMP();
console.log('getUniMPVersion: ' + JSON.stringify(ret)); console.log('getUniMPVersion: ' + JSON.stringify(ret));
}); });
}; };
const doInstallMP = (data) => { const doInstallMP = () => {
mp.installUniMP({ mp.installUniMP({
appid: appid, appid: appid,
wgtFile: wgtFile wgtFile: wgtFile
}, (r) => { }, (r) => {
if (0 == r.code) { if (0 == r.code) {
open(data); open();
} else { } else {
uni.hideLoading(); uni.hideLoading();
clearInterval(timer); clearInterval(timer);
@ -339,7 +326,6 @@ const doInstallMP = (data) => {
}; };
const open = (id = null) => { const open = (id = null) => {
uni.hideLoading()
uni.$emit('showLoading', false); uni.$emit('showLoading', false);
let token = uni.getStorageSync('LOGIN_STATUS_TOKEN'); let token = uni.getStorageSync('LOGIN_STATUS_TOKEN');
if (!token) return uni.showToast({ if (!token) return uni.showToast({
@ -348,12 +334,12 @@ const open = (id = null) => {
}) })
let avatar = store?.state?.userInfo?.avatar; let avatar = store?.state?.userInfo?.avatar;
mp.openUniMP({ mp.openUniMP({
appid: typeof(id) == 'object' ? appid : (id || appid), appid: id || appid,
extraData: { extraData: {
uniMP: true, uniMP: true,
token: token, token: token,
avatar: avatar, avatar: avatar,
}, }
}, (ret) => { }, (ret) => {
uni.hideLoading(); uni.hideLoading();
if (0 != ret.code) { if (0 != ret.code) {
@ -363,16 +349,7 @@ const open = (id = null) => {
showCancel: false showCancel: false
}); });
} }
console.log('openUniMP: ' + JSON.stringify(ret));
if (id.type == 2) {
setTimeout(() => {
console.log("发送给小程序的", id)
mp.sendUniMPEvent(appid, 'tocustomlist', id, (ret) => {
console.log("开始发送消息")
});
}, 1000)
}
}); });
} }

View File

@ -3,10 +3,11 @@ import {
uniMPgetLocation, uniMPgetLocation,
test test
} from "@/utils/uniMPfunction.js" } from "@/utils/uniMPfunction.js"
console.log(123)
export const initEvent = (data) => { export const initEvent = () => {
mp.onUniMPEventReceive(async (ret) => { mp.onUniMPEventReceive(async (ret) => {
console.log('小程序事件: ', data); console.log('小程序事件: ', ret);
// 用户如果没有注册商户 从小程序返回 入驻页面 // 用户如果没有注册商户 从小程序返回 入驻页面
if (ret.event == 'closeAppToOpenShop') { if (ret.event == 'closeAppToOpenShop') {
mp.closeUniMP(ret.fromAppid, (ret) => { mp.closeUniMP(ret.fromAppid, (ret) => {
@ -33,6 +34,20 @@ export const initEvent = (data) => {
console.log('获取定位'); console.log('获取定位');
let res = await uniMPgetLocation(); let res = await uniMPgetLocation();
console.log(res); console.log(res);
// plus.geolocation.getCurrentPosition(function(position) {
// console.log('经度:' + position.coords.longitude);
// console.log('纬度:' + position.coords.latitude);
// // that.markers[1].latitude = position.coords.longitude;
// // that.markers[1].longitude = position.coords.longitude;
// mp.sendUniMPEvent(
// ret.fromAppid,
// 'getLocation', {...position.coords},
// (ret) => {
// console.log('Host sendEvent: ' + JSON.stringify(ret));
// });
// }, function(error) {
// console.error('获取位置失败:', error.message);
// }, {provider:'gps'});
mp.sendUniMPEvent( mp.sendUniMPEvent(
ret.fromAppid, ret.fromAppid,
'getLocation', { 'getLocation', {
@ -57,10 +72,6 @@ export const initEvent = (data) => {
console.log('Host sendEvent: ' + JSON.stringify(ret)); console.log('Host sendEvent: ' + JSON.stringify(ret));
}); });
} }
if (ret.event == 'log') { if (ret.event == 'log') {
// console.log('2222222') // console.log('2222222')

View File

@ -24,15 +24,6 @@ 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,7 +8,6 @@
// | 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') {