新增积分商品功能 以及 在微信公众号优化部分逻辑

master
lemon橪 2021-07-27 18:14:53 +08:00
parent a6fec5cf70
commit a9db24d1ad
9 changed files with 182 additions and 174 deletions

View File

@ -6,10 +6,7 @@
const dev = { const dev = {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn", buyer: "https://buyer-api.pickmall.cn",
// common: 'http://192.168.0.101:8890',
// buyer: 'http://192.168.0.101:8888',
// seller: 'http://192.168.0.101:8889',
// manager: 'http://192.168.0.101:8887'
}; };
// 生产环境 // 生产环境

View File

@ -2,8 +2,8 @@
"name" : "lili商城", "name" : "lili商城",
"appid" : "__UNI__C100675", "appid" : "__UNI__C100675",
"description" : "", "description" : "",
"versionName" : "4.0.23", "versionName" : "4.0.24",
"versionCode" : 4000023, "versionCode" : 4000024,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"compatible" : { "compatible" : {

View File

@ -36,13 +36,7 @@
} }
}, },
{
"path": "pages/navigation/point/point-mall",
"style": {
"navigationBarTitleText": "积分商城",
"enablePullDownRefresh": true
}
},
{ {
"path": "pages/navigation/search/searchPage", "path": "pages/navigation/search/searchPage",
"style": { "style": {
@ -504,6 +498,13 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
}
},{
"path": "point/pointList",
"style": {
"navigationBarTitleText": "积分商城"
} }
} }
@ -752,12 +753,7 @@
"selectedIconPath": "static/tabbar/category-s.png", "selectedIconPath": "static/tabbar/category-s.png",
"text": "分类" "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", "pagePath": "pages/tabbar/cart/cartList",
"iconPath": "static/tabbar/cart.png", "iconPath": "static/tabbar/cart.png",

View File

@ -1,47 +1,46 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div class="box"> <div class="box">
<div class="block block-1"> <div class="block block-1">
<image class="img" src="@/pages/cart/static/pay.png" /> <image class="img" src="@/pages/cart/static/pay.png" />
<p class="ptips">收银台</p> <p class="ptips">收银台</p>
<p class="ptips">剩余支付时间 <p class="ptips">剩余支付时间
<u-count-down :show-days="false" :show-border="true" font-size="28" color="#008ffa" <u-count-down :show-days="false" :show-border="true" font-size="28" color="#008ffa" border-color="#008ffa" ref="uCountDown" :timestamp="autoCancel"></u-count-down>
border-color="#008ffa" ref="uCountDown" :timestamp="autoCancel"></u-count-down> </p>
</p> <p class="ptips">
<p class="ptips"> 支付金额
支付金额 <span>¥{{ cashierParams.price | unitPrice }}</span>
<span>¥{{ cashierParams.price | unitPrice }}</span> </p>
</p> </div>
</div> </div>
</div> <div class="__pay_form__">
<div class="__pay_form__"> </div>
</div> <div class="block-4" v-if="cashierParams.price > 0">
<div class="block-4" v-if="cashierParams.price > 0"> <div class="payItem">支付方式</div>
<div class="payItem">支付方式</div> <div class="payItem" v-for="(item, index) in payList" :key="index">
<div class="payItem" v-for="(item, index) in payList" :key="index"> <u-row class="row">
<u-row class="row"> <div class="col1" @click="awaitPay(item, index)" size="100" style="text-align:left;">
<div class="col1" @click="awaitPay(item, index)" size="100" style="text-align:left;"> <div v-if="item == 'ALIPAY'">
<div v-if="item == 'ALIPAY'"> <u-icon class="method_icon" name="zhifubao-circle-fill" color="#008ffa" size="80"></u-icon>
<u-icon class="method_icon" name="zhifubao-circle-fill" color="#008ffa" size="80"></u-icon> <span class="method_name">支付宝</span>
<span class="method_name">支付宝</span> </div>
</div> <div v-if="item == 'WECHAT'">
<div v-if="item == 'WECHAT'"> <u-icon class="method_icon" name="weixin-circle-fill" color="#00c98b" size="80"></u-icon>
<u-icon class="method_icon" name="weixin-circle-fill" color="#00c98b" size="80"></u-icon> <span class="method_name">微信</span>
<span class="method_name">微信</span> </div>
</div> <div v-if="item == 'WALLET'">
<div v-if="item == 'WALLET'"> <u-icon class="method_icon" name="red-packet-fill" color="#dd6161" size="80"></u-icon>
<u-icon class="method_icon" name="red-packet-fill" color="#dd6161" size="80"></u-icon> <span class="method_name">余额支付(当前余额¥{{ walletValue | unitPrice }})</span>
<span class="method_name">余额支付(当前余额¥{{ walletValue | unitPrice }})</span> </div>
</div> </div>
</div> <div class="col3" @click="awaitPay(item)" textAlign="right">
<div class="col3" @click="awaitPay(item)" textAlign="right"> <u-icon size="26" color="#b1b1b1" name="arrow-right"></u-icon>
<u-icon size="26" color="#b1b1b1" name="arrow-right"></u-icon> </div>
</div> </u-row>
</u-row> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import * as API_Trade from "@/api/trade"; import * as API_Trade from "@/api/trade";
@ -160,6 +159,10 @@
}); });
// #endif // #endif
//
var ua = window.navigator.userAgent.toLowerCase();
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN
@ -173,6 +176,14 @@
} }
// #endif // #endif
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
console.log("微信浏览器")
this.payList = res.data.result.support.filter((item) => {
return item != "ALIPAY";
});
}
this.walletValue = res.data.result.walletValue; this.walletValue = res.data.result.walletValue;
this.autoCancel = this.autoCancel =
(res.data.result.autoCancel - new Date().getTime()) / 1000; (res.data.result.autoCancel - new Date().getTime()) / 1000;
@ -376,108 +387,108 @@
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.method_icon { .method_icon {
vertical-align: middle; vertical-align: middle;
} }
.method_name { .method_name {
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #999;
padding-left: 24rpx; padding-left: 24rpx;
} }
.row { .row {
display: flex; display: flex;
width: 100%; width: 100%;
} }
/deep/ .u-row { /deep/ .u-row {
width: 100% !important; width: 100% !important;
display: flex; display: flex;
justify-content: space-between !important; justify-content: space-between !important;
} }
.method_name, .method_name,
.col1 { .col1 {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.col1 { .col1 {
text-align: center; text-align: center;
flex: 99; flex: 99;
} }
.col3 { .col3 {
text-align: right; text-align: right;
flex: 1; flex: 1;
} }
.payItem { .payItem {
padding: 13px 25rpx; padding: 13px 25rpx;
border-top: 1px solid #f9f9f9; border-top: 1px solid #f9f9f9;
line-height: 100rpx; line-height: 100rpx;
font-size: 36rpx; font-size: 36rpx;
color: #333; color: #333;
} }
.ptips { .ptips {
font-size: 32rpx; font-size: 32rpx;
margin: 20rpx 0; margin: 20rpx 0;
color: #333; color: #333;
>span { > span {
font-size: 40rpx; font-size: 40rpx;
color: #df5a52; color: #df5a52;
margin-left: 10rpx; margin-left: 10rpx;
} }
} }
.img { .img {
width: 392rpx !important; width: 392rpx !important;
height: 296rpx !important; height: 296rpx !important;
} }
.wrapper { .wrapper {
min-height: 100vh; min-height: 100vh;
height: auto; height: auto;
background: #f9f9f9; background: #f9f9f9;
} }
.block-4 { .block-4 {
background: #fff; background: #fff;
color: $u-tips-color; color: $u-tips-color;
>p { > p {
padding: 8rpx; padding: 8rpx;
} }
} }
.box { .box {
background: #fff; background: #fff;
padding: 40rpx 0; padding: 40rpx 0;
// justify-content: center; //X // justify-content: center; //X
// align-items: center; // Y // align-items: center; // Y
} }
.block { .block {
text-align: center; text-align: center;
display: block; display: block;
width: 100%; width: 100%;
image { image {
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
} }
} }
.block-1 { .block-1 {
margin-top: 80rpx; margin-top: 80rpx;
} }
.btns { .btns {
margin: 0 20rpx; margin: 0 20rpx;
} }
</style> </style>

View File

@ -190,10 +190,11 @@
<div class="box6 mp-iphonex-bottom" v-if="orderMessage.priceDetailDTO"> <div class="box6 mp-iphonex-bottom" v-if="orderMessage.priceDetailDTO">
<div class="tabbar-left"> <div class="tabbar-left">
合计 合计
<span class="number"> <span v-if="!orderMessage.priceDetailDTO.payPoint" class="number">
¥ ¥
<span>{{ orderMessage.priceDetailDTO.billPrice | unitPrice }}</span> <span>{{ orderMessage.priceDetailDTO.flowPrice | unitPrice }}</span>
</span> </span>
<span v-else class="number"><span style="margin-right:10rpx;">{{orderMessage.priceDetailDTO.payPoint | unitPrice }}</span>积分</span>
</div> </div>
<div class="navRiv" @click="createTradeFun()"> <div class="navRiv" @click="createTradeFun()">
<!-- #ifndef MP-WEIXIN --> <!-- #ifndef MP-WEIXIN -->

View File

@ -117,23 +117,23 @@ export default {
methods: { methods: {
/** 根据参数显示登录模块 */ /** 根据参数显示登录模块 */
methodFilter(code) { methodFilter(code) {
// let way = []; let way = [];
// this.loginList.forEach((item) => { this.loginList.forEach((item) => {
// if (code.length != 0) { if (code.length != 0) {
// code.forEach((val) => { code.forEach((val) => {
// if (item.code == val) { if (item.code == val) {
// way.push(item); way.push(item);
// } }
// }); });
// } else { } else {
// uni.showToast({ uni.showToast({
// title: '', title: '配置有误请联系管理员',
// duration: 2000, duration: 2000,
// icon:"none" icon:"none"
// }); });
// } }
// }); });
// this.loginList = way; this.loginList = way;
}, },
/**跳转到登录页面 */ /**跳转到登录页面 */
navigateLogin(connectLogin) { navigateLogin(connectLogin) {

View File

@ -23,7 +23,6 @@
</u-image> </u-image>
<view class="index-item-title">{{ item.goodsSku.goodsName }}</view> <view class="index-item-title">{{ item.goodsSku.goodsName }}</view>
<view class="index-item-price"> <view class="index-item-price">
{{ item.points | unitPrice }}积分 {{ item.points | unitPrice }}积分
<span class="tipsMkt">¥{{ item.goodsSku.price | unitPrice }}</span> <span class="tipsMkt">¥{{ item.goodsSku.price | unitPrice }}</span>
</view> </view>
@ -97,10 +96,11 @@ export default {
} }
}, },
}, },
async onShow() { async mounted() {
// //
let response = await getPointsCategory(); let response = await getPointsCategory();
if (response.data.success) { if (response.data.success) {
let navData = response.data.result.records; let navData = response.data.result.records;
navData.forEach((item) => { navData.forEach((item) => {
@ -273,12 +273,11 @@ page {
.swiper-box { .swiper-box {
// #ifdef H5 // #ifdef H5
height: calc(100vh - 294px); height: calc(100vh - (100rpx + 300rpx + 44px));
// #endif // #endif
// #ifndef H5 // #ifndef H5
height: calc(100vh - 400rpx);
height: calc(100vh - 200px);
// #endif // #endif
.scroll-v { .scroll-v {

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="user-point"> <div class="user-point">
<div class="point-rule">积分规则</div> <!-- <div class="point-rule">积分规则</div> -->
<div class="point-wrapper"> <div class="point-wrapper">
<u-image shape="circle" :lazy-load="true" width="100" height="100" :src="userInfo.face || '/static/missing-face.png'"></u-image> <u-image shape="circle" :lazy-load="true" width="100" height="100" :src="userInfo.face || '/static/missing-face.png'"></u-image>
<div class="whether-point"> <div class="whether-point">
@ -43,6 +43,7 @@ export default {
padding: 20rpx 0; padding: 20rpx 0;
} }
.point-wrapper { .point-wrapper {
padding-top: 80rpx;
display: flex; display: flex;
} }
.whether-point { .whether-point {

View File

@ -1,7 +1,9 @@
/** 配置楼层模块的跳转 */ /** 配置楼层模块的跳转 */
export function modelNavigateTo(item) { export function modelNavigateTo(item) {
let val = item.url; let val = item.url;
switch (val.___type) { switch (val.___type) {
case "goods": case "goods":
uni.navigateTo({ uni.navigateTo({
url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId, url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId,
@ -36,6 +38,7 @@ export function modelNavigateTo(item) {
break; break;
case "other": case "other":
switch (val.title) { switch (val.title) {
case "首页": case "首页":
uni.switchTab({ uni.switchTab({
url: `/pages/tabbar/home/index`, url: `/pages/tabbar/home/index`,
@ -92,8 +95,8 @@ export function modelNavigateTo(item) {
}); });
break; break;
case "积分商城": case "积分商城":
uni.switchTab({ uni.navigateTo({
url: `/pages/navigation/point/point-mall`, url: `/pages/promotion/point/pointList`,
}); });
break; break;
} }