修改看到的一些问题

master
lemon橪 2021-06-04 18:11:34 +08:00
parent fcb5d20ef1
commit 61273b78b9
21 changed files with 262 additions and 745 deletions

30
App.vue
View File

@ -1,4 +1,5 @@
<script>
/**
* vuex管理登录状态具体可以参考官方登录模板示例
@ -15,6 +16,35 @@ export default {
config,
};
},
/**
* 监听返回
*/
onBackPress(e) {
if (e.from == "backbutton") {
let routes = getCurrentPages();
let curRoute = routes[routes.length - 1].options;
routes.forEach((item) => {
if (
item.route == "pages/tabbar/cart/cartList" ||
item.route.indexOf("pages/product/goods") != -1
) {
uni.redirectTo({
url: item.route,
});
}
});
if (curRoute.addId) {
uni.reLaunch({
url: "/pages/tabbar/cart/cartList",
});
} else {
uni.navigateBack();
}
return true; //
}
},
methods: {
...mapMutations(["login"]),
},

View File

@ -1,25 +1,9 @@
/**
* 公共API
*/
import storage from "@/utils/storage.js"
import {http, Method} from '@/utils/request.js';
import api from '@/config/api.js';
/**
* 获取图片验证码URL
* @param type
* @param uuid
* @returns {string}
*/
export function getValidateCodeUrl(type, uuid) {
if (!type) {
return '';
}
if (!uuid) {
uuid = storage.getUuid()
}
return `${api.base}/captchas/${uuid}/${type}?r=${new Date().getTime()}`;
}
/**

View File

@ -1,8 +1,20 @@
/**
* 促销相关API
*/
import {http, Method} from '@/utils/request.js';
import { http, Method } from "@/utils/request.js";
/**
* 获取当前直播列表
*
* @param {*}
* @returns
*/
export function getLiveList() {
return http.request({
url: `broadcast/studio`,
method: Method.GET,
});
}
/**
* 获取当前拼团活动的未成团的会员
@ -14,24 +26,22 @@ export function getPromotionGroupMember(pintuanId) {
});
}
/** 获取拼团列表 */
export function getAssembleList(params) {
return http.request({
url: 'promotion/pintuan',
url: "promotion/pintuan",
method: Method.GET,
loading: false,
params
})
params,
});
}
/**
* 获取积分商城分类
*/
export function getPointsCategory() {
return http.request({
url: '/promotion/pointsGoods/category',
url: "/promotion/pointsGoods/category",
method: Method.GET,
});
}
@ -42,7 +52,7 @@ export function getPointsCategory() {
*/
export function getPointsGoods(params) {
return http.request({
url: '/promotion/pointsGoods',
url: "/promotion/pointsGoods",
method: Method.GET,
params,
});
@ -53,7 +63,7 @@ export function getPointsGoods(params) {
*/
export function getSeckillTimeLine() {
return http.request({
url: 'promotion/seckill',
url: "promotion/seckill",
method: Method.GET,
});
}
@ -75,7 +85,7 @@ export function getSeckillTimeGoods(timeline) {
*/
export function getAllCoupons(params) {
return http.request({
url: '/promotion/coupon',
url: "/promotion/coupon",
method: Method.GET,
params,
});

File diff suppressed because one or more lines are too long

View File

@ -49,31 +49,7 @@
</view>
</view>
</view>
<!-- <view
@click="hide"
v-show="flage"
class="flex-row-around"
style="border-radius: 10rpx; background-color: #ebebeb"
:style="{
width: width,
height: height,
'margin-left': left,
'margin-top': top,
}"
:class="vsr ? 'border-index' : ''"
>
<view class="flex-row-center" style="width: 45rpx; height: 45rpx">
<view v-show="!vsr" class="dh-wt"> </view>
<view
v-show="vsr"
class="cuIcon-roundcheck"
style="font-size: 45rpx; color: #07c160"
>
</view>
</view>
<text :class="vsr ? 'ttcl' : ''" style="color: #5a5a5a">{{ vsrtx }}</text>
<view class="cuIcon-safe text-gray"> </view>
</view> -->
</view>
</template>
@ -209,13 +185,12 @@ export default {
},
success: (res) => {
this.endLoad = true;
res.data.result == false
? (res.data.result = false)
: (res.data.result = true);
if (res.data && res.data.result) {
// // key,
//key,
this.$emit("send", this.key);
this.hide();
this.vsr = true;
@ -389,33 +364,6 @@ export default {
margin-top: -35rpx;
}
.lk-tag {
height: 50rpx;
padding: 0 10rpx;
display: flex;
justify-content: center;
align-items: center;
border: 2rpx solid #24bd9f;
border-radius: 6rpx;
color: #1c947a;
font-weight: 500;
}
.tb-tag-my {
border-radius: 15rpx;
font-size: 16rpx;
margin-left: 5rpx;
}
.my-green {
color: #29c7a5;
}
.my-hui {
color: #585858;
font-size: 22rpx;
}
.flex-column-center {
display: flex;
flex-direction: column;
@ -524,75 +472,15 @@ export default {
bottom: 70rpx;
}
.white-box {
padding: 0 20rpx;
margin-bottom: 15rpx;
margin-top: 5rpx;
width: 715rpx;
background-color: #ffffff;
border-radius: 30rpx;
}
.green-box {
padding: 0 20rpx;
margin-bottom: 15rpx;
margin-top: 5rpx;
width: 715rpx;
background-color: #ffffff;
border-radius: 30rpx;
background-image: linear-gradient(#1faf97, #29c7a5);
}
.yuan-sm {
width: 13rpx;
height: 13rpx;
border-radius: 50%;
background-color: #1fc189;
margin-left: 10rpx;
}
.yuan-normal {
width: 14rpx;
height: 14rpx;
border-radius: 50%;
background-color: #159f3c;
margin-left: 10rpx;
}
.yuan-normal-red {
width: 14rpx;
height: 14rpx;
border-radius: 50%;
background-color: #bc3c11;
margin-left: 10rpx;
}
.yuan-sm-red {
width: 13rpx;
height: 13rpx;
border-radius: 50%;
background-color: #de410d;
margin-left: 10rpx;
}
.white-box-all {
margin-top: 5rpx;
width: 750rpx;
background-color: #ffffff;
border-radius: 13px;
}
.moneycolor {
color: #ea5002;
}
.text-bold-sm {
font-weight: 425;
}
.sm-moneycolor {
color: #e3793b;
}
.margin-top {
margin-top: 20rpx;
@ -610,71 +498,13 @@ export default {
margin-left: 20rpx;
}
.margin-left-top {
margin-left: 20rpx;
margin-top: 20rpx;
}
.margin-right {
margin-right: 20rpx;
}
.my-absolute {
position: absolute;
}
.my-fixed {
position: fixed;
}
.my-seach {
width: 450rpx;
height: 55rpx;
background-color: #f8f8f8;
border-radius: 30rpx;
padding-left: 20rpx;
}
.move-view {
width: 48rpx;
height: 10rpx;
background-color: #28ba91;
border-radius: 4rpx;
margin-left: 100rpx;
}
.move-view-p {
width: 45rpx;
height: 10rpx;
background-color: #28ba91;
border-radius: 4rpx;
}
.header-dh {
position: fixed;
padding-top: 20rpx;
padding-bottom: 15rpx;
height: 70rpx;
width: 750rpx;
background-color: #f1f1f1;
z-index: 20;
}
.tp-normal {
width: 60rpx;
height: 60rpx;
}
.tp-sm {
width: 45rpx;
height: 45rpx;
}
.tp-big {
width: 70rpx;
height: 70rpx;
border-radius: 50%;
}
.main-color {
color: #07d188;

View File

@ -4,8 +4,10 @@
*/
// 开发环境
const dev = {
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
common: 'http://192.168.0.109:8890',
buyer: 'http://192.168.0.109:8888',
seller: 'http://192.168.0.109:8889',
manager: 'http://192.168.0.109:8887'
};
// 生产环境
const prod = {

15
main.js
View File

@ -2,7 +2,6 @@ import Vue from "vue";
import App from "./App";
import * as filters from "./utils/filters.js"; // global filter
import uView from "uview-ui";
import empty from "./components/empty";
import store from "./store";
// #ifdef H5
@ -12,6 +11,8 @@ let btn = Vue.component("airBtn", airBtn); //全局注册
document.body.appendChild(new btn().$mount().$el);
// #endif
Object.keys(filters).forEach((key) => {
Vue.filter(key, filters[key]);
});
@ -27,17 +28,15 @@ const msg = (title, duration = 1500, mask = false, icon = "none") => {
mask,
icon,
});
};
};
// 引入vuex
Vue.prototype.$store = store;
// 全局引入空组件
Vue.component("empty", empty);
Vue.prototype.$store = store;
Vue.use(uView);
Vue.config.productionTip = false;
Vue.config.productionTip = false;
// 主题色
Vue.prototype.$mainColor = "#ff3c2a";
Vue.prototype.$mainColor = "#ff3c2a";
// 高亮主题色
Vue.prototype.$lightColor = "#ff6b35";
Vue.prototype.$lightColor = "#ff6b35";
// 可直接 this.$api调用
Vue.prototype.$api = { msg };

View File

@ -197,7 +197,13 @@
"myPlugin" : {
"version" : "1.1.0",
"provider" : "wx738958e0f4c894f9"
}
},
"live-player-plugin": {
"version": "1.3.0",
"provider": "wx2b03c6e691cd7370"
}
}
},
"h5" : {

View File

@ -42,15 +42,7 @@
"navigationBarTitleText": "积分商城",
"enablePullDownRefresh": true
}
},
{
"path": "pages/navigation/selectShops",
"style": {
"navigationBarTitleText": "精选店铺"
}
},
},
{
"path": "pages/navigation/search/searchPage",
"style": {
@ -364,17 +356,17 @@
//app
"scrollIndicator": "none"
}
},
{ //
"path": "customerservice/index",
"style": {
"navigationBarTitleText": "客服",
"usingComponents": {
// #ifdef MP-WEIXIN
"chat": "plugin://myPlugin/chat"
// #endif
}
}
},
{ //
"path": "customerservice/index",
"style": {
"navigationBarTitleText": "客服",
"usingComponents": {
// #ifdef MP-WEIXIN
"chat": "plugin://myPlugin/chat"
// #endif
}
}
}
]
@ -435,7 +427,9 @@
"style": {
"navigationBarTitleText": "限时抢购",
"app-plus": {
"titleNView": {}
"titleNView": {
"homeButton":true
}
}
}
},
@ -462,7 +456,7 @@
"path": "lives",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
"navigationBarTextStyle": "black"
}
}
@ -584,6 +578,7 @@
"enablePullDownRefresh": true,
"app-plus": {
"bounce": "none"
}
}
},
@ -712,12 +707,12 @@
"text": "分类"
},
// {
// "pagePath": "pages/navigation/point/point-mall",
// "iconPath": "static/tabbar/point-mall.png",
// "selectedIconPath": "static/tabbar/point-mall-s.png",
// "text": "积分商城"
// },
{
"pagePath": "pages/navigation/point/point-mall",
"iconPath": "static/tabbar/point-mall.png",
"selectedIconPath": "static/tabbar/point-mall-s.png",
"text": "积分商城"
},
{
"pagePath": "pages/tabbar/cart/cartList",
"iconPath": "static/tabbar/cart.png",

View File

@ -1,30 +1,33 @@
<template>
<view class="myTracks">
<empty v-if="whetherEmpty"></empty>
<view v-else v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
<view class="myTracks-items">
<view class="myTracks-item">
<u-checkbox-group>
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="changeChecked(item)"></u-checkbox>
</u-checkbox-group>
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
<image :src="item.thumbnail"></image>
</view>
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
<view class="myTracks-item-title">
{{ item.goodsName }}
<view class="myTracks-item-title-desc"> </view>
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
<div v-else>
<view v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
<view class="myTracks-items">
<view class="myTracks-item">
<u-checkbox-group>
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="changeChecked(item)"></u-checkbox>
</u-checkbox-group>
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
<image :src="item.thumbnail"></image>
</view>
<view class="myTracks-item-price">
{{ item.price | unitPrice }}
<view class="myTracks-item-content" @click.stop="navgaiteToDetail(item)">
<view class="myTracks-item-title">
{{ item.goodsName }}
<view class="myTracks-item-title-desc"> </view>
</view>
<view class="myTracks-item-price">
{{ item.price | unitPrice }}
</view>
</view>
</view>
</view>
<view class="myTracks-divider"></view>
</view>
<view class="myTracks-divider"></view>
</view>
<uni-load-more :status="loadStatus"></uni-load-more>
<uni-load-more :status="loadStatus"></uni-load-more>
</div>
<view v-if="editFlag">
<view class="myTracks-action-placeholder"></view>
<view class="myTracks-action">

View File

@ -97,7 +97,7 @@ export default {
}
},
},
async mounted() {
async onShow() {
//
let response = await getPointsCategory();
if (response.data.success) {

View File

@ -1,325 +0,0 @@
<template>
<view class="selected-store">
<!-- 点击搜索出现搜索框 -->
<!-- <div v-show="searchHandle" class="searchBox">
<u-search placeholder="请输入关键字" :clearabled="true" :show-action="false" v-model="pageParams.name" @blur="searchStore()" @clear="clearSearch()" @confirm="searchStore()" ></u-search>
</div> -->
<div>
<empty v-if="nomsg"></empty>
<div class="swiper-item">
<scroll-view class="scroll-v" enableBackToTop="true" scroll-with-animation scroll-y>
<view class="index-item" v-for="(store,storeIndex) in stores" :key="storeIndex" @click.prevent="storeDetail(store.id)">
<div class="item-goods">
<u-image width="51px" height="51px" class="item-title-img" :src="store.storeLogo || noLogo">
<u-loading slot="loading"></u-loading>
</u-image>
<view class="item-content">
<view>
<span>{{ store.storeName }}</span><span class="self-store" v-if="store.selfOperated"></span>
</view>
<view>
<u-rate size="24" :count="5" :disabled="true" v-model="store.descriptionScore"></u-rate>
</view>
<view>{{ store.store_collect }} 关注</view>
<button v-if="store.is_connect==0" @click.stop="collectstore(store.id)" class="collect btn-mini">
<u-icon name="plus"></u-icon>
</button>
<button v-if="store.is_connect==1" @click.stop="collectstore(store.id)" class="collect btn-mini"></u-icon>已关注</button>
</view>
<view class="store-num">
<!-- <view> {{store.goods_num}}</view> -->
<view>进店逛逛</view>
</view>
</div>
</view>
<uni-load-more :status="loadStatus"></uni-load-more>
</scroll-view>
</div>
</div>
</view>
</template>
<script>
import { collectionStore } from "@/api/members.js";
import { getstoreList } from "@/api/store.js";
export default {
data() {
return {
tabIndex: 0,
currentLeft: 0,
stores: [],
pageParams: {
pageNumber: 1, //
pageSize: 10, //
category_id: 0, //
key_words: "", //
name: "", //
},
loadStatus: "more",
nomsg: false,
noLogo: require("@/static/logo.png"),
};
},
onLoad() {
this.searchStore();
},
watch: {
tabIndex(val) {
this.pageParams.pageNumber = 1;
this.stores = [];
this.loadStatus = "more";
this.searchStore();
},
},
onReachBottom() {
this.pageParams.pageNumber++;
this.searchStore();
},
methods: {
//
clearSearch() {
(this.pageParams = {
pageNumber: 1, //
pageSize: 10, //
category_id: 0, //
key_words: "", //
name: "", //
}),
this.searchStore();
},
async searchStore() {
uni.showLoading({
title: "加载中",
});
//
let response = await getstoreList(this.pageParams);
uni.hideLoading();
if (this.pageParams.name) {
this.stores = [];
}
this.stores = this.stores.concat(response.data.result.records);
uni.hideLoading();
if (
response.data.result.total <=
response.data.result.current * response.data.result.size
) {
this.loadStatus = "noMore";
} else {
this.loadStatus = "loadmore";
}
if (this.stores.length == 0) {
this.nomsg = true;
return;
}
},
collectstore(id) {
//
collectionStore(id).then((res) => {
if (res.statusCode == 200) {
this.$api.msg("收藏成功");
this.pageParams.pageNumber = 1;
this.stores = [];
this.searchStore();
}
});
},
storeDetail(id) {
uni.navigateTo({
url: "/pages/product/shopPage?id=" + id,
});
},
},
};
</script>
<style>
page {
height: 100%;
}
</style>
<style lang="scss" scoped>
.searchBox {
margin: 20rpx 0;
}
.selected-store {
height: 100%;
.list-scroll-content {
position: relative;
width: 100%;
display: flex;
white-space: nowrap;
align-items: center;
justify-content: space-between;
align-items: center;
background-color: #fff;
color: #333;
.tab-item {
width: 160rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
display: inline-block;
}
.active {
border-bottom: 2px solid #ffffff;
broder-width: 60rpx;
font-size: 30rpx;
padding-bottom: 4rpx;
}
}
.swiper-box {
height: calc(100% - 80rpx);
.scroll-v {
height: 100%;
}
}
.index-item {
// height: 535rpx;
margin: 20rpx;
background-color: #ffffff;
border-radius: 14rpx;
.item-goods {
height: 170rpx;
margin: 0 20rpx;
padding: 30rpx 0;
// border-bottom: 1px solid #eeeeee;
display: flex;
align-items: center;
image {
width: 102rpx;
height: 102rpx;
border-radius: 50%;
}
.item-title-img {
width: 102rpx !important;
height: 102rpx !important;
border-radius: 50% !important;
}
.item-content {
flex: 1;
line-height: 2em;
font-size: $font-sm;
position: relative;
.collect {
position: absolute;
width: 100rpx;
height: 40rpx;
font-size: 26rpx;
bottom: 20rpx;
right: 30rpx;
padding: 0;
line-height: 40rpx;
text-align: right;
padding-right: 14rpx;
.u-icon {
font-size: 26rpx;
position: absolute;
top: 7rpx;
left: 10rpx;
margin-right: 5rpx;
}
}
> view:first-child {
font-size: $font-base;
color: #333333;
font-weight: 700;
position: relative;
span:nth-child(2) {
position: absolute;
font-weight: 400;
top: 12rpx;
font-size: 18rpx;
margin-left: 20rpx;
height: 26rpx;
width: 50rpx;
line-height: 26rpx;
text-align: center;
color: #ffffff;
background-color: #ff6262;
border-radius: 4rpx;
}
}
color: #999;
margin-left: 30rpx;
}
.store-num {
width: 150rpx;
text-align: center;
border-left: 1px solid #eeeeee;
:nth-child(1) {
font-size: 26rpx;
}
:nth-child(2) {
font-size: 18rpx;
color: #999;
}
}
}
}
.goods-in-store {
height: 364rpx;
white-space: nowrap;
padding: 20rpx 0 20rpx 20rpx;
.goods-item {
width: 195rpx;
display: inline-block;
white-space: normal;
margin-right: 20rpx;
font-size: $font-sm;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
image {
width: 195rpx;
height: 195rpx;
border-radius: 8rpx;
}
> view {
margin-top: 10rpx;
}
.goods-item-img {
width: 195rpx !important;
height: 195rpx !important;
border-radius: 8rpx !important;
}
> view:nth-child(2) {
color: #ff5a10;
}
.goods-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
}
}
</style>

View File

@ -252,7 +252,6 @@ export default {
};
},
filters: {
/**
* 发票收据类型
*/
@ -403,73 +402,72 @@ export default {
/**
* 提交订单准备支付
*/
submit() {
if (!this.address.id) {
uni.showToast({
title: "请选择地址",
duration: 2000,
icon: "none",
});
return false;
}
//
let client;
// #ifdef H5
client = "H5";
// #endif
// #ifdef MP-WEIXIN
client = "WECHAT_MP";
// #endif
// #ifdef APP-PLUS
client = "APP";
// #endif
let submit = {
client,
way: this.routerVal.way,
remark: this.remarkVal,
parentOrderSn: "",
};
//
this.routerVal.parentOrder && this.routerVal.parentOrder.orderSn
? (submit.parentOrderSn = this.routerVal.parentOrder.orderSn)
: delete submit.parentOrderSn;
/**
* 创建订单
*/
API_Trade.createTrade(submit).then((res) => {
if (res.data.success) {
uni.showToast({
title: "创建订单成功!",
duration: 2000,
icon: "none",
});
// #ifdef MP-WEIXIN
//
this.pay(res.data.result.sn);
// #endif
// #ifndef MP-WEIXIN
this.navigateTo(
`/pages/cart/payment/payOrder?trade_sn=${res.data.result.sn}`
);
// #endif
} else {
uni.showToast({
title: "创建订单有误!请稍后重试",
duration: 2000,
icon: "none",
});
}
});
},
//
createTradeFun() {
//
this.$u.debounce(this.submit(), 3000);
this.$u.throttle(() => {
if (!this.address.id) {
uni.showToast({
title: "请选择地址",
duration: 2000,
icon: "none",
});
return false;
}
//
let client;
// #ifdef H5
client = "H5";
// #endif
// #ifdef MP-WEIXIN
client = "WECHAT_MP";
// #endif
// #ifdef APP-PLUS
client = "APP";
// #endif
let submit = {
client,
way: this.routerVal.way,
remark: this.remarkVal,
parentOrderSn: "",
};
//
this.routerVal.parentOrder && this.routerVal.parentOrder.orderSn
? (submit.parentOrderSn = this.routerVal.parentOrder.orderSn)
: delete submit.parentOrderSn;
/**
* 创建订单
*/
API_Trade.createTrade(submit).then((res) => {
if (res.data.success) {
uni.showToast({
title: "创建订单成功!",
duration: 2000,
icon: "none",
});
// #ifdef MP-WEIXIN
//
this.pay(res.data.result.sn);
// #endif
// #ifndef MP-WEIXIN
this.navigateTo(
`/pages/cart/payment/payOrder?trade_sn=${res.data.result.sn}`
);
// #endif
} else {
uni.showToast({
title: "创建订单有误!请稍后重试",
duration: 2000,
icon: "none",
});
}
});
}, 3000);
},
/**

View File

@ -7,7 +7,7 @@
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)">
<!-- 空白页 -->
<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
<u-empty text="暂无订单" mode="list" v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></u-empty>
<!-- 订单列表 -->
<view class="seller-view" :key="oderIndex" v-for="(order, oderIndex) in tabItem.orderList">
<!-- 店铺名称 -->
@ -67,10 +67,6 @@
</view>
</view>
</view>
<view class="nodata" v-if="tabItem.loadStatus === 'noMore'">
</view>
<uni-load-more :status="tabItem.loadStatus"></uni-load-more>
</scroll-view>
</swiper-item>
@ -100,14 +96,12 @@
<script>
import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
import empty from "@/components/empty";
import { getOrderList, cancelOrder, confirmReceipt } from "@/api/order.js";
import { getClearReason } from "@/api/after-sale.js";
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
export default {
components: {
uniLoadMore,
empty,
},
data() {
return {

View File

@ -143,7 +143,7 @@
</view>
<!-- 评价 -->
<Evaluation id="main5" :goodsDetail="goodsDetail" v-if="goodsDetail.id" />
<Evaluation id="main5" :goodsDetail="goodsDetail" />
<!-- 店铺推荐 -->
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />

View File

@ -5,7 +5,7 @@
<view class="evaluate-title">评价</view>
<text class="evaluate-num">{{ commDetail.total || '0' }}+</text>
<text class="tip">好评率 {{ goodsDetail.grade || '100' }}%</text>
<text class="tip">好评率 {{ grade || '100' }}%</text>
</view>
<div v-if="commDetail && commDetail.records && commDetail.records.length > 0">
<view class="eva-box" v-for="(commItem,commIndex) in commDetail.records.slice(0,2)" :key="commIndex">
@ -51,6 +51,7 @@ export default {
lightColor: this.$lightColor,
//
commDetail: [],
grade: "",
//
params: {
pageNumber: 1,
@ -59,9 +60,25 @@ export default {
},
};
},
props: ["goodsDetail"],
props: {
goodsDetail: {
default: {},
type: Object,
},
},
watch: {
goodsDetail: {
handler(val) {
this.grade = val.grade;
this.getGoodsComments();
},
deep: true,
immediate: true,
},
},
mounted() {
this.getGoodsComments();
// this.getGoodsComments();
},
methods: {
parseLoaded() {

View File

@ -13,33 +13,32 @@
<div class="wrapper">
<!-- 直播中 全部 直播回放 -->
<div class="live-list">
<div class="live-item" :class="{'invalid':item.status == 'END'}" v-for="(item,index) in liveList" :key="index" @click="handleLivePlayer(item)">
<div class="live-cover-img">
<div class="tips">
<div class="live-box">
<image class="live-gif" src="./static/live.gif"></image>
</div>
<span> 直播中</span>
<span>{{item.status == 'END' ? '已结束' : item.status =='NEW' ? '未开始' : '直播中'}}</span>
</div>
<div class="bg"></div>
<image class="zan" src="./static/zan.gif" mode="" />
<u-image width="326" height="354" src="https://lilishop-oss.oss-cn-beijing.aliyuncs.com/fe5b8167b0264c53836d08a6a7003cf0.jpeg" />
<u-image width="326" height="354" :src="item.shareImg" />
</div>
<div class="live-goods">
<image src="./static/live.png" class="live-icon" mode="" />
<div class="live-goods-name">
甄选家电好物尽在超值5月
{{item.name}}
</div>
<div class="live-store">
<u-image shape="circle" width="50" height="50" src="https://gfs14.gomein.net.cn/T11wElB7Cv1RCvBVdK_360.jpg?v=1" />
<span class="wes">lilishop</span>
</div>
<div class="live-goods-list">
<div class="live-goods-item">
<u-image border-radius="20" height="140"></u-image>
<u-image border-radius="20" :src="item.roomGoodsList.length !=0 ? item.roomGoodsList[0] : ''" height="140"></u-image>
</div>
<div class="live-goods-item">
<u-image border-radius="20" height="140"></u-image>
<u-image border-radius="20" :src="item.roomGoodsList.length !=0 ? item.roomGoodsList[1] : ''" height="140"></u-image>
</div>
</div>
@ -50,11 +49,12 @@
</template>
<script>
import { getLiveList } from "@/api/promotions.js";
export default {
data() {
return {
activeColor: this.$lightColor,
keyword: "",
//
tabs: [
{
@ -72,6 +72,8 @@ export default {
background: {
background: "#ff9f28",
},
//
liveList: "",
//
swiperImg: [
{
@ -89,6 +91,46 @@ export default {
],
};
},
mounted() {
this.getLives();
},
methods: {
/**
*
*/
async getLives() {
let res = await getLiveList();
if (res.data.success) {
this.liveList = res.data.result.records;
this.liveList.forEach((item) => {
console.log();
});
}
},
/**
* 推荐直播间
*/
async getStarLive() {},
/**
* 进入直播间
*/
handleLivePlayer(val) {
let roomId = val.roomId; // API
let customParams = encodeURIComponent(
JSON.stringify({ path: "pages/index/index", pid: 1 })
); // 600
uni.navigateTo({
url:
"plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=" +
roomId +
"&custom_params=" +
customParams,
});
},
},
};
</script>
@ -96,16 +138,18 @@ export default {
.slot-wrap {
display: flex;
align-items: center;
/* 如果您想让slot内容占满整个导航栏的宽度 */
flex: 1;
/* 如果您想让slot内容与导航栏左右有空隙 */
/* padding: 0 30rpx; */
}
.invalid {
filter: grayscale(1);
}
.wrapper {
padding: 0 24rpx;
}
.live-list {
.live-item {
display: flex;
overflow: hidden;
border-radius: 20rpx;
@ -138,10 +182,6 @@ export default {
margin: 20rpx 0;
overflow: hidden;
width: calc(100% - 50rpx);
> span {
color: #999;
margin-left: 20rpx;
}
}
.live-gif {
width: 20rpx;
@ -168,6 +208,7 @@ export default {
padding-right: 38rpx;
}
}
.live-icon,
.zan {
position: absolute;

View File

@ -69,22 +69,7 @@
this.goods = response.data;
},
onBackPress() {
// uni.preloadPage({
// url: '/pages/tabbar/home/index',
// success: function(res) {
// // eventChannel
// }
// });
// //退
// uni.switchTab({
// url: '/pages/tabbar/home/index?' + new Date().getTime(),
// success: function(res) {
// // eventChannel
// }
// });
},
methods: {
//

View File

@ -6,7 +6,9 @@
</template>
<script>
import tpl from "@/pages/tabbar/home/views.vue";
export default {
data() {
return {
background: {

View File

@ -10,7 +10,6 @@ const store = new Vuex.Store({
/**
* 是否需要强制登录
*/
forcedLogin: false,
distributionId:"", //分销员Id 如果当前账户从未登录过时记录

View File

@ -38,7 +38,6 @@ function getTokenDebounce() {
}
})
.catch((error) => {
console.log(error);
cleanStorage();
success = false;
lock = false;