优化部分页面以及逻辑

master
lemon橪 2021-07-15 15:10:27 +08:00
parent 2df8be328f
commit fc9b7bac16
20 changed files with 871 additions and 94 deletions

View File

@ -1,34 +1,28 @@
import {
http
} from "@/utils/request.js";
import api from '@/config/api.js'
import { http } from "@/utils/request.js";
import api from "@/config/api.js";
/**
* 通过短信重置密码
* @param mobile
*/
export function resetByMobile(params) {
return http.request({
url: `/members/resetByMobile`,
method: "POST",
params
});
return http.request({
url: `/members/resetByMobile`,
method: "POST",
params,
});
}
/**
* 发送验证码
* @param mobile
*/
export function sendMobile(mobile) {
return http.request({
url: `${api.common}/sms/LOGIN/${mobile}`,
method: "GET",
});
return http.request({
url: `${api.common}/sms/LOGIN/${mobile}`,
method: "GET",
});
}
/**
@ -37,40 +31,37 @@ export function sendMobile(mobile) {
* @param smsCode
*/
export function smsLogin(params, clientType) {
return http.request({
url: `/members/smsLogin`,
method: "POST",
data: params,
header: {
"content-type": "application/x-www-form-urlencoded",
"clientType": clientType
}
});
return http.request({
url: `/members/smsLogin`,
method: "POST",
data: params,
header: {
"content-type": "application/x-www-form-urlencoded",
clientType: clientType,
},
});
}
/**
* 修改密码
* @param newPassword
* @param password
*/
export function modifyPass(params) {
return http.request({
url: `/members/modifyPass`,
method: "PUT",
params,
});
export function modifyPass(params) {
return http.request({
url: `/members/modifyPass`,
method: "PUT",
params,
});
}
/**
* 刷新token
*/
export function refreshTokenFn(refresh_token) {
return http.request({
url: `/members/refresh/${refresh_token}`,
method: "GET",
});
return http.request({
url: `/members/refresh/${refresh_token}`,
method: "GET",
});
}

View File

@ -13,7 +13,7 @@ export function getLiveList(params) {
return http.request({
url: `broadcast/studio`,
method: Method.GET,
params
params,
});
}
@ -91,3 +91,72 @@ export function getAllCoupons(params) {
params,
});
}
/**
* 分页获取砍价商品
* @param params
*/
export function getBargainList(params) {
return http.request({
url: "/promotion/kanjiaGoods",
method: Method.GET,
params,
});
}
/**
* 分页获取砍价商品
* @param params
*/
export function getBargainDetail(id) {
return http.request({
url: `/promotion/kanjiaGoods/${id}`,
method: Method.GET,
});
}
/**
* 获取砍价活动
* @param params
*/
export function getBargainActivity(params) {
return http.request({
url: `/promotion/kanjiaGoods/getKanjiaActivity`,
method: Method.POST,
params,
});
}
/**
* 发起砍价活动
* @param params
*/
export function openBargain(params) {
return http.request({
url: `/promotion/kanjiaGoods`,
method: Method.POST,
header: { "content-type": "application/x-www-form-urlencoded" },
data: params,
});
}
/**
* 分页获取砍价活动-帮砍记录
*/
export function getBargainLog(params) {
return http.request({
url: `/promotion/kanjiaGoods/getKanjiaActivity/logs`,
method: Method.GET,
data: params,
});
}
/**
* 分页获取砍价活动-帮砍记录
*/
export function helpBargain(kanJiaActivityId) {
return http.request({
url: `promotion/kanjiaGoods/help/${kanJiaActivityId}`,
method: Method.POST,
});
}

View File

@ -72,10 +72,14 @@ export default {
// h5
// #ifdef H5
copyLink() {
let content =
this.configs.shareLink +
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
let content;
if (this.link) {
content = this.configs.shareLink + this.link;
} else {
content =
this.configs.shareLink +
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
}
if (content === null || content === undefined) {
content = "";
} else content = content + "";
@ -104,6 +108,8 @@ export default {
shareTitle = `我发现了一个${this.goodsName}店铺快来跟我一起看看吧`;
} else if (this.type == "pintuan") {
shareTitle = `我拼了一个${this.goodsName}快来跟我一起抢购吧!`;
} else if (this.type == "kanjia") {
shareTitle = `请快来帮我砍一刀${this.goodsName}`;
}
let scene; // "WXSenceTimeline WXSceneSession "

View File

@ -4,10 +4,9 @@
*/
// 开发环境
const dev = {
// common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn",
common: "http://192.168.0.106:8890",
buyer: "http://192.168.0.106:8888",
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
};
// 生产环境
const prod = {

View File

@ -483,6 +483,20 @@
"navigationStyle": "custom",
"navigationBarTextStyle": "black"
}
},{
"path": "bargain/list",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},{
"path": "bargain/detail",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
}

View File

@ -94,18 +94,11 @@ export default {
formatList: [],
currentSelceted: [],
skuList: "",
isMask:false, //
isClose:false, //
isMask: false, //
isClose: false, //
};
},
props: [
"goodsDetail",
"buyMask",
"selectedSku",
"goodsSpec",
"addr",
],
props: ["goodsDetail", "buyMask", "selectedSku", "goodsSpec", "addr"],
watch: {
buyType: {
handler(val) {
@ -162,7 +155,25 @@ export default {
};
this.selectName = specValue.value;
this.$emit("handleClickSku", selectedSkuId.skuId,this.goodsDetail.id);
this.$emit("handleClickSku", selectedSkuId.skuId, this.goodsDetail.id);
},
/**
* 直接购买
*/
buy(data) {
API_trade.addToCart(data).then((res) => {
if (res.data.code == 200) {
uni.navigateTo({
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
this.addr.id || ""
}&parentOrder=${encodeURIComponent(
JSON.stringify(this.parentOrder)
)}`,
});
}
});
},
/**
@ -208,19 +219,7 @@ export default {
data.cartType = "BUY_NOW";
}
API_trade.addToCart(data).then((res) => {
if (res.data.code == 200) {
uni.navigateTo({
url: `/pages/order/fillorder?way=${data.cartType}&addr=${
this.addr.id || ''
}&parentOrder=${encodeURIComponent(
JSON.stringify(this.parentOrder)
)}`,
});
}
});
this.buy(data);
}
},
formatSku(list) {

View File

@ -57,7 +57,9 @@
applyInfo.refundWay == 'ORIGINAL' ? '原路退回' : '账号退款'
" type="text" input-align="right" :disabled="true" />
</u-form-item>
<view >
<view v-if="
applyInfo.accountType === 'BANK_TRANSFER' &&
applyInfo.applyRefundPrice != 0">
<u-form-item label="银行开户行" :label-width="150">
<u-input v-model="form.bankDepositName" type="text" input-align="right" placeholder="请输入银行开户行" />
</u-form-item>
@ -97,7 +99,7 @@ import {
import city from "@/components/m-city/m-city";
import { upload } from "@/api/common.js";
import {checkBankno} from '@/utils/Foundation'
import { checkBankno } from "@/utils/Foundation";
import storage from "@/utils/storage.js";
export default {
component: {
@ -146,7 +148,7 @@ export default {
customStyle: {
backgroundColor: this.$lightColor,
},
applyInfo: {},
applyInfo: {},
form: {
orderItemSn: "", // sn
skuId: "",
@ -188,8 +190,8 @@ export default {
this.sn = options.sn;
let dsku = decodeURIComponent(options.sku);
let newSku = JSON.parse(dsku);
this.sku = newSku
this.sku = newSku;
this.form.orderItemSn = options.sn;
this.form.skuId = this.sku.skuId;
this.form.num = this.sku.num;
@ -251,9 +253,7 @@ export default {
this.form.accountType_label = e[0].label;
},
//
returnSelectConfirm(e) {
},
returnSelectConfirm(e) {},
//
valChange(e) {
@ -261,7 +261,6 @@ export default {
},
//
onUploaded(lists) {
let images = [];
lists.forEach((item) => {
@ -297,7 +296,6 @@ export default {
},
//
handleCheckParams() {
if (this.$u.test.isEmpty(this.form.reason)) {
this.$refs.uToast.show({ title: "请选择 退款原因", type: "error" });
return false;

View File

@ -25,7 +25,16 @@
{{ comment.goodsName }}
</view>
<view class="goods-subtitle"></view>
<view class="commentStyle" v-if="comment.reply">
商家回复
<span class="addCommentSpan">{{ comment.reply }}</span>
<view class="img">
<!-- 循环出商家回复评价的图片 -->
<u-image width="140rpx" height="140rpx" v-if="comment.replyImage" v-for="(replyImg, replyIndex) in splitImg(comment.replyImage)" :src="replyImg" :key="replyIndex"
@click="preview(splitImg( comment.replyImage), index)">
</u-image>
</view>
</view>
</view>
</view>
</view>
@ -49,6 +58,18 @@ export default {
this.comment = JSON.parse(decodeURIComponent(options.comment));
},
methods: {
/**
* 切割图像
*/
splitImg(val) {
if (val && val.split(",")) {
return val.split(",");
} else if (val) {
return val;
} else {
return false;
}
},
/**
* 点击图片放大或保存
*/
@ -68,6 +89,38 @@ export default {
</script>
<style lang="scss" scoped>
.commentStyle {
margin-top: 16rpx;
padding: 14rpx 26rpx;
background: #f5f5f5;
border-radius: 6px;
font-size: 22rpx;
font-weight: 700;
text-align: left;
line-height: 40rpx;
}
.img {
display: flex;
flex-wrap: wrap;
/* height: 140rpx; */
overflow: hidden;
margin: 10rpx 0;
image {
width: 166rpx;
height: 166rpx;
margin: 0 15rpx 15rpx 0;
&:nth-of-type(3n + 0) {
margin: 0 0 15rpx 0;
}
}
}
.addCommentSpan {
color: $u-tips-color !important;
padding-left: 20rpx;
}
.memName {
font-size: 28rpx;
}

View File

@ -39,9 +39,9 @@
<view class="btn-view u-flex u-row-between">
<view class="description">
<!-- 等待付款 -->
<text v-if="order.payStatus === 'PAID'"></text>
<text v-else></text>
<text class="price">{{ order.flowPrice | unitPrice }}</text>
<div v-if="order.payStatus === 'PAID'">:</div>
<div v-else>:</div>
<div class="price">{{ order.flowPrice | unitPrice }}</div>
</view>
<view>
<!-- 全部 -->
@ -623,9 +623,10 @@ page,
font-size: 26rpx;
.description {
display: flex;
color: #909399;
size: 25rpx;
size: 24rpx;
flex: 1;
.price {
color: $main-color;
}

View File

@ -204,7 +204,7 @@
</view>
</u-popup>
<u-toast ref="uToast" />
<u-modal v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" @confirm="confirmRog"></u-modal>
<u-modal v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" :confirm-color="lightColor" @confirm="confirmRog"></u-modal>
<!-- 分享 -->
<shares v-if="shareFlage " :thumbnail="orderDetail.orderItems[0].image" :goodsName="orderDetail.orderItems[0].goodsName" @close="shareFlage = false" />
@ -447,12 +447,13 @@ export default {
confirmRog() {
confirmReceipt(this.orderSn).then((res) => {
if (res.data.success) {
this.$refs.uToast.show({
uni.showToast({
title: "已确认收货",
type: "success",
duration: 2000,
icon: "none",
});
this.rogShow = false;
this.loadData(options.sn);
this.loadData(this.sn);
}
});
},
@ -653,7 +654,7 @@ page,
}
}
}
.verificationCode{
.verificationCode {
font-weight: bold;
letter-spacing: 2rpx;
}

View File

@ -0,0 +1,499 @@
<template>
<div class="page">
<u-navbar back-icon-color="#fff" :background="background" :border-bottom="false" title=""></u-navbar>
<div class="wrapper">
<!-- 砍价列表 -->
<div class="box box1">
<div class="bargain">
<div class="flex bargain-item">
<div class="goods-img">
<u-image width="200" height="200" :src="bargainDetail.thumbnail"></u-image>
</div>
<div class="goods-config">
<div class="goods-title wes-2">
{{bargainDetail.goodsName}}
</div>
<div class="flex price-box">
<div class="purchase-price">当前:<span>{{ activityData.surplusPrice == 0 ? this.bargains.purchasePrice : activityData.surplusPrice | unitPrice}}</span>
</div>
<div class="max-price">原价:<span>{{ bargainDetail.price | unitPrice}}</span>
</div>
</div>
<div class="tips">{{bargainDetail.sellingPoint}}</div>
</div>
</div>
<!-- 砍价进度 -->
<div class="bargain-progress">
<u-line-progress class="line" :active-color="lightColor" striped striped-active :percent="totalPercent"></u-line-progress>
<div class="flex tips">
<div>已砍{{cutPrice}}</div>
<div>还剩{{activityData.surplusPrice}}</div>
</div>
</div>
<!-- 参与砍价 -->
<div class="bargaining" v-if="!activityData.pass" @click="shareBargain">
邀请砍价
</div>
<!-- 立即购买 -->
<div class="buy" v-else @click="getGoodsDetail">
立即购买
</div>
</div>
</div>
<!-- 帮砍列表 -->
<div class="box box2">
<div class="bargain">
<div class="bargain-title">帮忙砍</div>
<div class="user-item flex" v-if="logData.length !=0 " v-for="(item,index) in logData" :key="index">
<div>
<u-image width="75" shape="circle" height="75" :src="item.kanjiaMemberFace"></u-image>
</div>
<div class="user-config flex">
<div class="user-name">
<div>{{item.kanjiaMemberName | noPassByName}}</div>
<div>使出吃的奶劲儿</div>
</div>
<div class="save">砍掉<span>{{item.kanjiaPrice | unitPrice}}</span></div>
</div>
</div>
</div>
</div>
<!-- 产品详情 -->
<div class="box box3">
<div class="bargain">
<div class="bargain-title">商品详情</div>
<view class="u-content">
<u-parse :html="bargainDetail.mobileIntro"></u-parse>
</view>
</div>
</div>
<!-- 砍价 -->
<u-modal title="恭喜您砍掉了" v-model="Bargaining" mask-close-able :show-confirm-button="false" :title-style="{color: lightColor}">
<view class="slot-content">
<u-count-to :start-val="0" ref="uCountTo" font-size="100" :color="lightColor" :end-val="kanjiaPrice" :decimals="2" :autoplay="autoplay"></u-count-to><span class="price"></span>
</view>
</u-modal>
<!-- 帮砍 -->
<u-modal :show-title="false" v-model="helpBargainFlage" :show-confirm-button="false">
<view class="help-bargain" @click="handleClickHelpBargain">
<u-image width="100%" height="600rpx" src="/pages/promotion/static/bargain.jpeg"></u-image>
<u-image class="help" width="300rpx" height="80rpx" src="/pages/promotion/static/help-bargain.png"></u-image>
</view>
</u-modal>
<!-- 分享 -->
<shares @close="closeShare" :link="'/pages/promotion/bargain/detail?id='+routerVal.id+'&activityId='+activityData.id" type="kanjia" :thumbnail="bargainDetail.thumbnail"
:goodsName="bargainDetail.goodsName" v-if="shareFlage " />
<!-- 购买 -->
<popupGoods :addr="addr" ref="popupGoods" :buyMask="maskFlag" @closeBuy="closePopupBuy" :goodsDetail="bargainDetail" :goodsSpec="goodsSpec" v-if="bargainDetail.id "
@handleClickSku="getGoodsDetail" />
<!-- 产品详情 -->
<div class=" box4">
</div>
</div>
</div>
</template>
<script>
import popupGoods from "@/pages/cart/payment/popup/goods"; //
import {
getBargainDetail,
getBargainActivity,
openBargain,
getBargainLog,
helpBargain,
} from "@/api/promotions";
import { getGoods } from "@/api/goods.js";
import shares from "@/components/m-share/index";
export default {
components: {
shares,
popupGoods,
},
data() {
return {
background: {
backgroundColor: "transparent",
},
maskFlag: false, //
shareFlage: false,
lightColor: this.$lightColor,
bargains: {},
bargainDetail: {}, //
Bargaining: false, //
helpBargainFlage: false, //
autoplay: false, //
kanjiaPrice: 0, //
totalPercent: 0, //
activityData: "", //
cutPrice: 0, //
params: {
// id: "", //ID
// kanjiaActivityGoodsId: "", //SkuID
// kanjiaActivityId: "", //ID
// status: "", //
},
logData: [], //
//
logParams: {
pageNumber: 1,
pageSize: 20,
kanJiaActivityId: "",
},
goodsDetail: {}, //
goodsSpec: {}, //
selectedGoods: "", //
};
},
onLoad(options) {
this.routerVal = options;
if (options.activityId) {
this.params.kanjiaActivityId = options.activityId;
}
},
onShow() {
this.init();
},
watch: {
//
Bargaining(val) {
if (val) {
this.$nextTick(() => {
this.$refs.uCountTo.start();
});
}
},
//
activityData: {
handler(val) {
if (val) {
//
this.totalPercent =
100 -
Math.floor((val.surplusPrice / this.bargainDetail.price) * 100);
this.cutPrice = (
this.bargainDetail.price - this.activityData.surplusPrice
).toFixed(2);
//
this.logParams.kanJiaActivityId = val.id;
//
if (this.params.kanjiaActivityId && val.help) {
this.helpBargainFlage = true;
}
this.getBargainLogList();
}
},
immediate: true,
},
},
methods: {
closePopupBuy(val) {
this.maskFlag = false;
},
closeShare() {
this.shareFlage = false;
},
//
shareBargain() {
this.shareFlage = true;
},
//
getGoodsDetail() {
uni.showLoading({
title: "加载中",
mask: true,
});
this.$refs.popupGoods.buy({
skuId: this.bargainDetail.id,
num: 1,
cartType: "KANJIA",
});
// getGoods(this.bargainDetail.id, this.bargainDetail.goodsId).then(
// (response) => {
// this.goodsDetail = response.data.result.data;
// this.selectedGoods = response.data.result.data;
// this.goodsSpec = response.data.result.specs;
// uni.hideLoading();
// // this.maskFlag = true;
// }
// );
},
//
async init() {
//
let res = await getBargainDetail(this.routerVal.id);
if (res.data.success) {
this.bargainDetail = res.data.result.goodsSku;
this.bargains = res.data.result;
// id
if (this.params.kanjiaActivityId) {
} else {
this.params.kanjiaActivityGoodsId = this.routerVal.id;
}
//
this.activity();
}
},
//
async activity() {
let res = await getBargainActivity(this.params);
//
res.data.success
? res.data.result
? (this.activityData = res.data.result)
: this.openActivity()
: "";
},
// -
async getBargainLogList() {
let res = await getBargainLog(this.logParams);
if (res.data.success) {
this.logData = res.data.result.records;
}
},
//
async handleClickHelpBargain() {
let res = await helpBargain(this.params.kanjiaActivityId);
if (res.data.success) {
this.helpBargainFlage = false;
this.kanjiaPrice = res.data.result.kanjiaPrice;
this.Bargaining = true;
//
this.init();
} else {
this.helpBargainFlage = false;
}
},
//
async openActivity(data) {
let res = await openBargain({ id: this.routerVal.id });
if (res.data.success) {
this.kanjiaPrice = res.data.result.kanjiaPrice;
this.Bargaining = true;
//
this.init();
}
},
},
};
</script>
<style lang="scss">
page {
background-color: $light-color !important;
}
</style>
<style lang="scss" scoped>
.slot-content {
display: flex;
align-items: flex-end;
justify-content: center;
margin: 20rpx 0 80rpx 0;
}
.price {
margin-left: 10rpx;
color: $light-color;
}
.price-box {
align-items: center;
padding: 10rpx 0;
}
.wrapper {
background: url("../static/Bargaining.png");
background-repeat: no-repeat;
background-size: 100% 100%;
height: 700rpx;
width: 100%;
}
.box {
background: #fff;
border-radius: 20rpx;
position: relative;
width: 94%;
margin: 0 auto;
> .bargain {
padding: 32rpx;
}
}
.box1 {
top: 750rpx;
}
.box2 {
top: 770rpx;
}
.box3 {
top: 790rpx;
}
.box4 {
top: 810rpx;
height: 200rpx;
}
.bargain-item {
align-items: center;
}
.goods-config {
margin-left: 20rpx;
> .goods-title {
font-weight: bold;
}
}
.max-price,
.purchase-price {
font-size: 24rpx;
color: #999;
}
.max-price {
margin-left: 10rpx;
text-decoration: line-through;
}
.purchase-price {
color: $main-color;
> span {
font-size: 32rpx;
font-weight: bold;
}
}
.bargaining,
.buy {
font-size: 24rpx;
color: #fff;
width: 80%;
margin: 50rpx auto 0 auto;
text-align: center;
font-size: 30rpx;
background-image: linear-gradient(
25deg,
$main-color,
$light-color,
$aider-light-color
);
padding: 18rpx;
border-radius: 100px;
animation: mymove 5s infinite;
-webkit-animation: mymove 5s infinite; /*Safari and Chrome*/
animation-direction: alternate; /*轮流反向播放动画。*/
animation-timing-function: ease-in-out; /*动画的速度曲线*/
/* Safari 和 Chrome */
-webkit-animation: mymove 5s infinite;
-webkit-animation-direction: alternate; /*轮流反向播放动画。*/
-webkit-animation-timing-function: ease-in-out; /*动画的速度曲线*/
}
@keyframes mymove {
0% {
transform: scale(1); /*开始为原始大小*/
}
25% {
transform: scale(1.1); /*放大1.1倍*/
}
50% {
transform: scale(1);
}
75% {
transform: scale(1.1);
}
}
.line {
margin: 20rpx 0;
}
.tips {
font-size: 24rpx;
color: #999;
justify-content: space-between;
}
.bargain-progress {
margin: 20rpx 0;
}
.bargain-title {
font-size: 32rpx;
font-weight: bold;
color: $light-color;
text-align: center;
margin-bottom: 40rpx;
}
.user-item {
margin: 40rpx 0;
align-items: center;
}
.user-config {
margin-left: 20rpx;
flex: 8;
align-items: center;
justify-content: space-between;
> .user-name {
> div:nth-of-type(1) {
font-size: 28rpx;
}
> div:nth-last-of-type(1) {
font-size: 24rpx;
color: #999;
}
}
}
.save {
color: $light-color;
> span {
font-weight: bold;
}
}
.mobile-intro {
overflow: hidden;
max-width: 100%;
}
@keyframes fontMove {
0% {
transform: scale(1); /*开始为原始大小*/
}
25% {
transform: scale(1.1); /*放大1.1倍*/
}
50% {
transform: scale(1);
}
75% {
transform: scale(1.1);
}
}
.help-bargain {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
> .help {
margin-bottom: 40rpx;
border-radius: 20rpx;
margin-top: 40rpx;
animation: fontMove 5s infinite;
-webkit-animation: fontMove 5s infinite; /*Safari and Chrome*/
animation-direction: alternate; /*轮流反向播放动画。*/
animation-timing-function: ease-in-out; /*动画的速度曲线*/
/* Safari 和 Chrome */
-webkit-animation: fontMove 5s infinite;
-webkit-animation-direction: alternate; /*轮流反向播放动画。*/
-webkit-animation-timing-function: ease-in-out; /*动画的速度曲线*/
}
}
</style>

View File

@ -0,0 +1,133 @@
<template>
<div class="page">
<u-navbar back-icon-color="#fff" :background="background" :border-bottom="false" title=""></u-navbar>
<div class="wrapper">
<!-- 砍价列表 -->
<div class="box">
<div class="bargain" v-if="bargainList.length!=0">
<div class="flex bargain-item" v-for="(item,index) in bargainList" :key="index">
<div class="goods-img">
<u-image width="150" height="150" :src="item.thumbnail"></u-image>
</div>
<div class="goods-config">
<div class="goods-title wes-2">
{{item.goodsName}}
</div>
<div class="flex goods-buy">
<div class="max-price">最低<span>{{item.purchasePrice | unitPrice}}</span></div>
<div class="bargaining" @click="navigateToBargainDetail(item)"></div>
</div>
</div>
</div>
</div>
<div class="bargain empty" v-else>
<u-empty text="暂无活动" mode="list"></u-empty>
</div>
</div>
</div>
</div>
</template>
<script>
import { getBargainList } from "@/api/promotions";
export default {
data() {
return {
background: {
backgroundColor: 'transparent',
},
params: {
promotionStatus: "START", ///
pageNumber: 1,
pageSize: 20,
},
bargainList: [], //
};
},
onShow() {
this.init();
},
methods: {
/**
* 初始化砍价列表
*/
async init() {
let res = await getBargainList(this.params); //
if (res.data.success) {
this.bargainList = res.data.result.records;
}
},
//
navigateToBargainDetail(val) {
uni.navigateTo({
url: `/pages/promotion/bargain/detail?id=${val.id}`,
});
},
},
};
</script>
<style lang="scss">
page{
background-color: $light-color !important;
}
</style>
<style lang="scss" scoped>
.wrapper {
background: url("../static/Bargaining.png");
background-repeat: no-repeat;
background-size: 100% 100%;
height: 700rpx;
width: 100%;
}
.box {
background: #fff;
border-radius: 20rpx;
position: relative;
top: 750rpx;
width: 94%;
margin: 0 auto;
> .bargain {
padding: 32rpx;
}
}
.bargain-item {
align-items: center;
border-bottom: 1rpx solid #f6f6f6;
padding: 32rpx 0;
}
.goods-config {
flex: 8;
margin-left: 20rpx;
> .goods-title {
height: 80rpx;
font-weight: bold;
}
}
.max-price {
color: $main-color;
font-size: 24rpx;
> span {
font-size: 32rpx;
font-weight: bold;
}
}
.goods-buy {
margin: 10rpx 0;
align-items: center;
justify-content: space-between;
}
.bargaining {
font-size: 24rpx;
color: #fff;
background: $light-color;
padding: 10rpx 24rpx;
border-radius: 100px;
}
.empty {
height: 400rpx;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -86,6 +86,11 @@ export function modelNavigateTo(item) {
url: `/pages/promotion/lives`,
});
break;
case "砍价":
uni.navigateTo({
url: `/pages/promotion/bargain/list`,
});
break;
case "积分商城":
uni.switchTab({
url: `/pages/navigation/point/point-mall`,

View File

@ -94,6 +94,8 @@ export default {
},
mounted() {
this.init();
// #ifdef MP-WEIXIN
//

View File

@ -174,3 +174,11 @@ $font-weight: 400;
white-space: nowrap;
text-overflow: ellipsis;
}
.wes-2 {
/* 适用于webkit内核和移动端 */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}

View File

@ -147,7 +147,6 @@ http.interceptors.request.use(
...config.header,
uuid: storage.getUuid() || uuid.v1(),
};
console.log(config.header);
return config;
},
(config) => {