支付成功

This commit is contained in:
魏啾
2024-04-18 14:36:14 +08:00
parent 007d9e4336
commit 4bc97b35fd
11 changed files with 1145 additions and 140 deletions

View File

@@ -2,6 +2,9 @@ export default {
userwxlogin(data) { //登录
return uni.api.post("/login/wx/custom/login", data);
},
loginapplogin(data) { //APP登录(登录即注册)
return uni.api.post("/login/app/login", data);
},
productqueryProduct(data) { //获取商品信息
return uni.api.post("/product/queryProduct", data);
},
@@ -47,4 +50,31 @@ export default {
logingetPhoneNumber(data) { //小程序获取手机号
return uni.api.post("/login/getPhoneNumber", data);
},
cashierServiceloginregister(data) { //用户注册
return uni.api.post("/cashierService/login/register", data);
},
cashierServiceloginregister(data) { //APP登录
return uni.api.post("/login/app/login", data);
},
phoneValidateCode(data) { //验证码
return uni.api.get("/phoneValidateCode", data);
},
homehomePageUp(data) { //首页上半部分
return uni.api.post("/home/homePageUp", data);
},
home(data) { //首页上半部分
return uni.api.post("/home", data,false);
},
locationdistrict(data) { //获取行政区域(区,街道)
return uni.api.get("/location/district", data);
},
ordermineCoupons(data) { //我的优惠券
return uni.api.get("/order/mineCoupons", data,false);
},
ordergetYhqPara(data) { //获取优惠券参数列表
return uni.api.get("/order/getYhqPara", data);
},
orderfindCoupons(data) { //系统优惠券
return uni.api.get("/order/findCoupons", data);
},
}

View File

@@ -1,20 +0,0 @@
export default {
cashierServiceloginregister(data) { //用户注册
return uni.api.post("/cashierService/login/register", data);
},
cashierServiceloginregister(data) { //APP登录
return uni.api.post("/login/app/login", data);
},
phoneValidateCode(data) { //验证码
return uni.api.get("/phoneValidateCode", data);
},
homehomePageUp(data) { //首页上半部分
return uni.api.post("/home/homePageUp", data);
},
home(data) { //首页上半部分
return uni.api.post("/home", data);
},
locationdistrict(data) { //获取行政区域(区,街道)
return uni.api.get("/location/district", data);
},
}

View File

@@ -4,7 +4,6 @@ import useStorage from '@/utils/useStroage.js'
import './framework/bootstrap'
import Api from "./common/js/api.js"
import Shop from "./common/js/shop.js"
import Ashopx from "./common/js/apix.js"
import store from './store'
// #ifndef VUE3
import Vue from 'vue'
@@ -24,7 +23,6 @@ uni.$u.config.unit = 'rpx'
Vue.prototype.useStorage = useStorage
Vue.prototype.api = Api;
Vue.prototype.shop = Shop;
Vue.prototype.apix = Ashopx;
// #ifdef VUE3
import {
createSSRApp

View File

@@ -56,6 +56,13 @@
"navigationBarTitleText": "订单详情"
}
},
{
"path": "pages/order/successful",
"style": {
"navigationBarTitleText": "支付成功",
"navigationStyle": "custom"
}
},
{
"path": "pages/member/index",
"style": {
@@ -104,7 +111,7 @@
{
"path": "pages/user/coupon",
"style": {
"navigationBarTitleText": "我的优惠"
"navigationBarTitleText": "优惠"
}
},
{

View File

@@ -4,14 +4,93 @@
<view class="containertopbox">
<view class="containertopboxone flex-start">
<view>可使用红包</view>
<text>200</text>
<text>{{totalnumber}}</text>
</view>
<view class="containertopboxitem flex-start">
<view class="containertopboxitemleft">
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
<view class="containertopboxitemleft flex-colum"
:class="item.status == 0?'':'containertopboxitemlefts'">
<view class="containertopboxitemleft_one"
:class="item.status == 0?'':'containertopboxitemleft_ones'">
<text style="font-size: 28rpx;"></text>
<text>{{item.couponsAmount || 0}}</text>
</view>
<view class="containertopboxitemleft_tow"
:class="item.status == 0?'':'containertopboxitemleft_tows'">
优惠券()
</view>
</view>
<view class="containertopboxitemright">
<view class="containertopboxitemright_one">
无门槛使用
</view>
<view class="containertopboxitemright_tow">
通用红包券
</view>
<view class="containertopboxitemright_there">
有效期至{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
</view>
<view
:class="item.status == 0?'containertopboxitemright_four':'containertopboxitemright_fours'">
{{item.status == 0 ? '兑换积分':'已过期'}}
</view>
</view>
</view>
</view>
<navigator url="/pages/user/coupon" hover-class="navigator-hover"
style="margin-top: 20rpx;font-weight: 400;font-size: 28rpx;text-align: center; width: 100%;">
查看更多
</navigator>
</view>
<view class="containerbottom">
<view class="containerbottomtop">
<view class="containerbottomtoptopbox flex-start">
<view>可购买红包</view>
<text>根据您的订单金额推荐更适合您的优惠力度</text>
</view>
</view>
<view class="containerbottombox_bottom">
<view class="containerbottombox_bottomone">
购买省钱包本单立减
</view>
<view v-for="(item,index) in orderlist" :key="index">
<view class="containerbottombox_bottomtow">
{{item.name}}
</view>
<view class="containerbottombox_bottombox flex-start" v-for="(item1,index1) in item.listdata"
:key="index1">
<view class="containerbottombox_bottomthere">
<view class="containerbottombox_bottomthere_topitem">
<view class="onecontainerbottombox_bottomthere_topitem">
<view class="containerbottombox_bottomthere_topitemone">
通用红包
</view>
<view class="containerbottombox_bottomthere_topitemtow flex-center">
<view class="a">
¥
</view>
<view class="b">
{{item1.couponsAmount}}
</view>
<view class="c">
无门槛
</view>
</view>
</view>
<view class="towcontainerbottombox_bottomthere_topitem">
有效期{{$u.timeFormat(item1.updateTime, 'yyyy/mm/dd') || '0'}}
</view>
</view>
<view class="therecontainerbottombox_bottomthere_topitem flex-around" @click="clickicon(item1)">
<u-icon v-if="item1.id == item1id" name="checkmark-circle" color="#F1CB66"
size="45"></u-icon>
<text v-else class="theretext"></text>
<view :class="item1.id == item1id?'c':'b'">
<text :class="item1.id == item1id?'c':'b'"
style="font-size:20rpx ;">¥</text>{{item1.couponsPrice}}/
</view>
</view>
</view>
</view>
</view>
</view>
@@ -22,7 +101,64 @@
<script>
export default {
data() {
return {};
return {
totalnumber: '',
list: [],
orderlist: [{
listdata: {},
}], //获取优惠券参数列表
item1id: '',
form: {
page: 1, //页数
size: 10, //页容量
status: 'loadmore'
},
};
},
onShow() {
this.ordermineCouponsthis()
this.ordergetYhqParass()
},
methods: {
clickicon(e){
this.item1id = e.id
},
async ordergetYhqParass() { //类型列表
let res = await this.api.ordergetYhqPara()
try {
this.orderlist = res.data
for (let i = 0; i <= res.data.length; i++) {
this.orderfindCouponses(i, this.orderlist[i].name);
}
} catch (e) {
//TODO handle the exception
}
},
async orderfindCouponses(i, name) {
let res = await this.api.orderfindCoupons({
page: 1,
size: 10,
type: name
})
this.orderlist[i].listdata = res.data.list
console.log(this.orderlist)
this.$forceUpdate();
},
async ordermineCouponsthis() {
let res = await this.api.ordermineCoupons({
userId: uni.cache.get('userInfo').id,
status: 0,
page: this.form.page,
size: this.form.size
})
try {
this.totalnumber = res.data.total
this.list = res.data.list.slice(0, 2)
} catch (e) {
//TODO handle the exception
}
},
}
};
</script>
@@ -51,49 +187,319 @@
}
.containertopboxitem {
margin-top: 20rpx;
width: 100%;
position: relative;
::after {
content: '';
position: absolute;
top: -16rpx;
left: 166rpx;
background: #f9f9f9;
display: inline-block;
width: 32rpx;
height: 32rpx;
border-radius: 50%;
}
::before {
content: '';
position: absolute;
bottom: 0rpx;
left: 166rpx;
background: #f9f9f9;
display: inline-block;
width: 32rpx;
height: 16rpx;
line-height: 32rpx;
border-radius: 32rpx 32rpx 0 0;
}
.containertopboxitemleft {
position: relative;
width: 182rpx;
height: 192rpx;
background: #F1CB66;
border-radius: 18rpx 0rpx 0rpx 18rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
::after {
content: '';
position: absolute;
top: 0rpx;
left: 166rpx;
background: #f9f9f9;
display: inline-block;
width: 32rpx;
height: 16rpx;
border-radius: 0 0 32rpx 32rpx;
z-index: 999;
}
::before {
content: '';
position: absolute;
bottom: 0rpx;
left: 166rpx;
background: #f9f9f9;
display: inline-block;
width: 32rpx;
height: 16rpx;
line-height: 32rpx;
border-radius: 32rpx 32rpx 0 0;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
z-index: 999;
}
.containertopboxitemleft_one {
text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 60rpx;
color: #FFFFFF;
}
}
.containertopboxitemleft_ones {
text {
color: #999999;
}
}
.containertopboxitemleft_tow {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
}
.containertopboxitemleft_tows {
color: #999999;
}
}
.containertopboxitemlefts {
background: #F7F7F7;
}
.containertopboxitemright {
position: relative;
padding: 0 32rpx;
flex: auto;
height: 192rpx;
background: #FFFFFF;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
border-radius: 0rpx 18rpx 18rpx 0rpx;
.containertopboxitemright_one {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #666666;
padding: 12rpx 0;
border-bottom: 1rpx dotted #707070;
}
.containertopboxitemright_tow {
margin-top: 14rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.containertopboxitemright_there {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #999999;
}
.containertopboxitemright_four {
position: absolute;
right: 32rpx;
top: 50%;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
padding: 0 14rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: #FE665E;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
.containertopboxitemright_fours {
position: absolute;
right: 32rpx;
top: 50%;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #999999;
padding: 0 14rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: #F7F7F7;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
}
}
}
}
.containerbottom {
.containerbottomtop {
padding: 0 32rpx;
.containerbottomtoptopbox {
view {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #666666;
}
}
}
.containerbottombox_bottom {
margin-top: 16rpx;
width: 100%;
background: #FFFFFF;
border-radius: 42rpx 0rpx 0rpx 42rpx;
// overflow-x: auto;
.containerbottombox_bottomone {
padding: 20rpx 64rpx 0 64rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.containerbottombox_bottomtow {
margin-top: 16rpx;
padding: 0 64rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
.containerbottombox_bottombox {
padding-left: 34rpx;
width: 100%;
overflow-x: auto;
flex-wrap: nowrap;
.containerbottombox_bottomthere:nth-child(1) {
margin-left: 0;
}
.containerbottombox_bottomthere {
margin-top: 16rpx;
margin-left: 46rpx;
.containerbottombox_bottomthere_topitem {
width: 236rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
display: flex;
flex-direction: column;
align-items: center;
background: #fd5977;
.towcontainerbottombox_bottomthere_topitem {
padding: 20rpx 0 16rpx 0;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 20rpx;
color: #FFFFFF;
}
.onecontainerbottombox_bottomthere_topitem::after {
content: '';
position: absolute;
bottom: -6rpx;
width: 100%;
height: 20rpx;
background: #fef7f5;
left: 0;
z-index: 1;
border-radius: 0 0 50% 50%;
}
.onecontainerbottombox_bottomthere_topitem {
position: relative;
background: #fef7f5;
width: 100%;
z-index: 99;
.containerbottombox_bottomthere_topitemone {
width: 136rpx;
height: 40rpx;
background: #F1CB66;
text-align: center;
border-radius: 0rpx 0rpx 20rpx 20rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #333333;
line-height: 40rpx;
margin: auto;
}
.containerbottombox_bottomthere_topitemtow {
align-items: baseline;
width: 100%;
.a {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 40rpx;
color: #FF4C11;
}
.b {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 70rpx;
color: #FF4C11;
}
.c {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FF4C11;
}
}
.containerbottombox_bottomthere_topitemthere {
position: relative;
height: 50rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 20rpx;
color: #FFFFFF;
width: 100%;
z-index: 9;
}
}
}
.therecontainerbottombox_bottomthere_topitem {
width: 100%;
margin-top: 20rpx;
.theretext {
width: 40rpx;
height: 40rpx;
background: #FFFFFF;
border: 2rpx solid #E8E8E8;
border-radius: 50%;
}
.c {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #FF4C11;
}
.b {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
}
}

View File

@@ -231,7 +231,7 @@
},
data() {
return {
timersetInterval:'0', //定时器
timersetInterval: '0', //定时器
isFixedTop: false, //吸顶是否显示
Topdistance: 3000, //吸顶初始距离
keyword: '',
@@ -280,7 +280,7 @@
},
onHide() {
this.timersetInterval = '1'
},
computed: {
HeighT() { //手机类型的尺寸
@@ -335,7 +335,7 @@
// 首页上面数据
async hometop() {
try {
let res = await this.apix.homehomePageUp()
let res = await this.api.homehomePageUp()
this.hometoplist = res.data
} catch (e) {}
},
@@ -344,8 +344,8 @@
this.homelist = []
this.form = {
address: '西安市', //地址
lng:'108.949158',
lat:'34.301731',
lng: '108.949158',
lat: '34.301731',
type: '', //品类
orderBy: 0, //1.理我最近 2.销量优先 3.价格优先
other: '', //附近1KM 1选中 0不选中
@@ -357,7 +357,7 @@
},
async onLoadhome() {
try {
let res = await this.apix.home(this.form)
let res = await this.api.home(this.form)
var dates = new Date().getTime();
res.data.forEach((item, index) => {
var leftTime = item.endTime - dates; //计算两日期之间相差的毫秒数
@@ -398,7 +398,7 @@
async viewHistory(item, index) {
this.viewHistoryindex = index
if (item.dictName == 'allCity') {
let res = await this.apix.locationdistrict({
let res = await this.api.locationdistrict({
keywords: '西安市'
})
this.clickhometoplistmenulist = res.data[0]
@@ -453,7 +453,10 @@
console.log(category);
this.hometoplist.menu[this.viewHistoryindex].name = category.name
this.showproductlist = false
this.form.address = category.center
console.log(category.center.split(','))
let res = category.center.split(',')
this.form.lng = res[0]
this.form.lat = res[1]
this.form.page = 1
this.form.size = 10
this.form.status = 'loadmore'

View File

@@ -37,10 +37,18 @@
<text @click="register">注册账号</text>
<text @click="passwords">忘记密码</text>
</view>
<!-- #ifdef MP-WEIXIN -->
<button class="toLogin" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="!showbox">手机号快速登录
</button>
<view class="toLogin" v-if="showbox" @click="toLoginconfirm">登录</view>
<view class="toLogins" @click="showbox = !showbox">其他手机号登录/注册</view>
<!-- #endif -->
<!-- #ifdef APP-PLUS || H5 -->
<button class="toLogin" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="!showbox">手机号快速登录
</button>
<view class="toLogin" v-if="showbox" @click="toLoginconfirm">登录</view>
<view class="toLogins" @click="showbox = !showbox">其他手机号登录/注册</view>
<!-- #endif -->
<view class="agreement flex-start">
<u-checkbox-group><u-checkbox shape="circle" @change="radioChange"
size="24"></u-checkbox></u-checkbox-group>
@@ -50,7 +58,7 @@
<view class="agreement-Item" @click="Privacy(2)">隐私政策</view>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<!-- #ifdef APP-PLUS || H5 -->
<view class="box_conf" v-if="debug" @click="showpicker = true">{{ baseUrl || '切换' }}</view>
<!-- #endif -->
<u-overlay :show="agreeShow">
@@ -93,6 +101,7 @@
showpopup: false,
valueinput: '',
showbox: false,
columns: [
['http://admintestapi.sxczgkj.cn/', 'https://ky.sxczgkj.cn', 'http://192.168.2.22:7004',
'http://admintestapi.sxczgkj.cn/', '自定义输入'
@@ -121,7 +130,11 @@
this.computed_h();
},
onLoad() {},
onLoad() {
// #ifdef APP-PLUS || H5
this.showbox = true
// #endif
},
methods: {
// 同意隐私政策
agree() {
@@ -145,7 +158,7 @@
},
// 拒绝隐私政策-退出应用
refuse() {
// #ifdef APP-PLUS
// #ifdef APP-PLUS || H5
//android 退出方法
plus.runtime.quit();
// ios 退出方法
@@ -163,18 +176,17 @@
},
async CodeRegister() {
//发起验证码
if (this.form.telephone == null || this.form.telephone == '') {
if (this.form.loginName == null || this.form.loginName == '') {
uni.showToast({
title: '请输入电话号码',
icon: 'none'
});
return false;
}
const res = await this.apix.phoneValidateCode({
const res = await this.api.phoneValidateCode({
// post 手机验证码
phone: this.form.telephone
phone: this.form.loginName
});
console.log(res);
if (res) {
uni.showToast({
title: '验证码获取成功',
@@ -240,7 +252,7 @@
height: h
};
},
async toLogin() {
async toLoginconfirm() {
//登录
if (this.form.loginName == null || this.form.loginName == '') {
uni.showToast({
@@ -249,14 +261,6 @@
});
return false;
}
if (this.form.password == null || this.form.password == '' || uni.$u.trim(this.form.password, 'all') ==
'') {
uni.showToast({
title: '请输入密码或密码不能输入空格',
icon: 'none'
});
return false;
}
if (this.radioChangeItem == false) {
uni.showToast({
icon: 'none',
@@ -264,45 +268,21 @@
});
return;
}
let res = await this.api.Login({
loginName: this.form.loginName,
password: this.form.password
let res = await this.api.loginapplogin({
username: this.form.loginName,
password: this.form.password,
code: this.form.code
});
console.log(res);
if (res.code == 200) {
uni.cache.set('loginName', this.form.loginName + '');
uni.cache.set('password', this.form.password + '');
uni.cache.set('token', res.data.userApp.token);
uni.cache.set('myLoginName', res.data.userInfo.loginName);
uni.cache.set('userId', res.data.userInfo.id);
if (res.code == 0) {
uni.cache.set('token', res.data.token);
uni.cache.set('miniAppOpenId', res.data.userInfo
.miniAppOpenId)
uni.cache.set('userInfo', res.data.userInfo);
uni.cache.set('userApp', res.data.userApp);
// 积分商城用到的token
// uni.cache.set('rechargeToken', res.data.rechargeToken);
this.$store.commit('set_login', true);
this.$store.commit('userInfo', res.data.userInfo);
this.$store.commit('userApp', res.data.userApp);
this.$store.dispatch('USerVoiceactions'); //获取语音播报初始数据
// #ifdef APP-PLUS
try {
let pinf = plus.push.getClientInfo();
let cid = (pinf && pinf.clientid) || ''; //客户端标识
uni.cache.set('cid', cid);
let res = await this.api.pushbindalias({
cid: cid
});
console.log('cid res===', res);
console.log('cid===', cid);
} catch (e) {
console.log('ciderr===', e);
//TODO handle the exception
}
// #endif
uni.pro.switchTab('/pages/index/index');
} else {
this.$api.msg(res.message);
// uni.cache.set('shopUser', res.data.shopUser);
uni.pro.switchTab('index/index')
}
},
async getPhoneNumber(res) { // 获取手机号
var resdataa = res
@@ -321,12 +301,47 @@
this.phone = resdata.data
this.userlogin()
}
// this.userlogin()
}
});
// #endif
},
async userlogin() {
// #ifdef MP-WEIXIN
uni.login({
provider: 'weixin',
success: async (data) => {
try {
uni.getUserInfo({
provider: 'weixin',
success: async (infoRes) => {
uni.cache.set('weixincode', data.code);
let res = await this.api.userwxlogin({
code: uni.cache.get('weixincode'), //临时登录凭证
encryptedData: infoRes
.encryptedData, // 用户非敏感信息
rawData: infoRes.rawData,
signature: infoRes.signature,
iv: infoRes.iv,
phone: this.phone
})
if (res.code == 0) {
uni.cache.set('token', res.data.token);
uni.cache.set('miniAppOpenId', res.data.userInfo
.miniAppOpenId)
uni.cache.set('userInfo', res.data.userInfo);
uni.cache.set('shopUser', res.data.shopUser);
uni.pro.switchTab('index/index')
}
},
fail: (err) => {
console.log(err)
}
});
} catch (e) {
console.log(e)
}
}
});
// #endif
},
}

View File

@@ -94,7 +94,7 @@ export default {
});
return false;
}
const res = await this.apix.phoneValidateCode({
const res = await this.api.phoneValidateCode({
// post 手机验证码
phone: this.form.telephone
});
@@ -194,7 +194,7 @@ export default {
});
return;
}
let res = await this.apix.cashierServiceloginregister({
let res = await this.api.cashierServiceloginregister({
telephone: this.form.telephone,
nickName: this.form.nickName,
password: this.form.password,

266
pages/order/successful.vue Normal file
View File

@@ -0,0 +1,266 @@
<template>
<view class="content">
<!-- 占位符导航栏 -->
<navseat class="navbar" :opacity='opacitys' :title='titlename'></navseat>
<view class="onecontent">
<view :style="[{'padding-top':HeighT.customBar +44+'px'}]"></view>
<view class="onecontentabsolute flex-center">
<image class="onecontentabsoluteimage"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/dui.png" mode="aspectFill"></image>
<view class="onecontentabsolutebox flex-colum-start">
<text>支付成功</text>
<text style="margin-top: 16rpx;font-size: 24rpx;">感谢您的购买</text>
</view>
</view>
</view>
<view class="towcontent">
<view class="towcontentone">
75.00
</view>
<view class="towcontentow flex-between">
<view class="towcontentow_O">
订单编号
</view>
<view class="towcontentow_T">
94789546123301
</view>
</view>
<view class="towcontentow flex-between">
<view class="towcontentow_O">
下单时间
</view>
<view class="towcontentow_T">
2023-05-16 13:20:12
</view>
</view>
<view class="towcontentow flex-between">
<view class="towcontentow_O">
支付方式
</view>
<view class="towcontentow_T">
微信支付
</view>
</view>
<view class="towcontenthere flex-colum">
<view class="towcontentherebox flex-center">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/yhj.png" mode=""></image>
<text>恭喜获得优惠券</text>
</view>
</view>
</view>
</view>
</template>
<script>
import navseat from '@/components/navseat.vue'
export default {
components: {
navseat
},
data() {
return {
titlename: '支付详情',
opacitys: false,
towcontentclickindex: 0,
windowHeight: '',
seighT: '',
customheighttop: '', //top高度
isFixedTop: false,
Topdistance: 3000, //吸顶初始距离
listbox: [{
name: '全部'
},
{
name: '美食正餐'
},
{
name: '饮品小吃'
}
],
form: {
address: '', //地址
type: '', //品类
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
distance: '', //附近1KM 1选中 0不选中
page: 1, //页数
size: 10, //页容量
status: 'loadmore'
},
};
},
onPageScroll(e) {
if (e.scrollTop <= 44) { //搜索导航栏
this.opacitys = false
} else {
this.opacitys = true
}
if (e.scrollTop >= this.Topdistance) { //类别导航栏
this.isFixedTop = true
} else {
this.isFixedTop = false
}
},
onLoad() {
setTimeout(() => {
this.GetTop()
}, 1000)
},
computed: {
HeighT() { //手机类型的尺寸
return this.$store.getters.is_BarHeight
},
},
methods: {
//G滚动底部
loadMore(e) {
console.log(e)
},
//获取元素距离顶部的距离
GetTop() {
uni.getSystemInfo({
success: (data) => {
console.log(data)
this.windowHeight = data.windowHeight - data.statusBarHeight //总高度
// #ifdef MP-WEIXIN
const custom = wx.getMenuButtonBoundingClientRect()
this.seighT = data.windowHeight - custom.height - custom.top;
console.log(custom)
this.customheighttop = custom.height + custom.top
// #endif
// #ifdef APP-PLUS
this.customheighttop = data.statusBarHeight / 2
this.seighT = data.windowHeight - data.statusBarHeight / 2
// #endif
this.$u.getRect('.towcontentlistxitembt').then(res => {
this.seighT = this.seighT - res.height //高度
})
this.$u.getRect('.towcontentlistxitem').then(res => {
this.Topdistance = res.top - this.HeighT.heightBar //滚动距离 //滚动距离
this.seighT = this.seighT - res.height //高度
console.log(res)
})
}
})
},
towcontentclick(index) {
this.towcontentclickindex = index
}
}
};
</script>
<style scoped lang="scss">
page {}
.content {
.onecontent {
position: relative;
z-index: 99;
width: 100%;
// #ifdef APP-PLUS || H5
height: 498.1rpx;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/successful.png) no-repeat;
// #endif
// #ifdef MP-WEIXIN
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/successfules.png) no-repeat;
height: 586rpx;
// #endif
background-size: cover;
.onecontentabsolute {
position: absolute;
width: 100%;
margin-top: 50rpx;
.onecontentabsoluteimage {
width: 98.53rpx;
height: 93.63rpx;
}
.onecontentabsolutebox {
margin-left: 42rpx;
text {
font-family: PingFang SC, PingFang SC;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
}
}
}
}
.towcontent {
position: relative;
z-index: 100;
top: -148rpx;
margin: 0 auto;
width: 630rpx;
background: #FFFFFF;
border-radius: 0rpx 0rpx 24rpx 24rpx;
padding: 0 24rpx;
.towcontentone {
padding-top: 26rpx;
width: 100%;
text-align: center;
font-family: Roboto, Roboto;
font-weight: bold;
font-size: 44rpx;
color: #333333;
}
.towcontentow {
margin-top: 16rpx;
.towcontentow_O {
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #999999;
}
.towcontentow_T {
font-family: PingFang SC, PingFang SC;
font-weight: bold;
font-size: 24rpx;
color: #333333;
}
}
.towcontenthere{
margin-top: 32rpx;
border-top: 1rpx dashed #E5E5E5;
.towcontentherebox{
margin-top: 32rpx;
image{
width: 38.48rpx;
height: 38.42rpx;
}
text{
font-family: PingFang SC, PingFang SC;
font-weight: bold;
font-size: 28rpx;
color: #333333;
}
}
.towcontenthereimage{
}
}
}
.towcontent::after {
content: '';
position: absolute;
top: -14rpx;
left: -32rpx;
width: 694rpx;
height: 14rpx;
background: #FFA556;
border-radius: 12rpx 12rpx 12rpx 12rpx;
}
}
</style>

View File

@@ -1,11 +1,49 @@
<template>
<view class="container">
<view class="towcontent">
<view class="towcontentlistxitem flex-start">
<view class="towcontentlistxitembox flex-colum"
:class="towcontentclickindex == index?'towcontentlistxitemboxopacity':''"
v-for="(item,index) in listbox" :key="index" @click="towcontentclick(index,item)">
<text>{{item.name}}</text>
<image v-if="towcontentclickindex == index"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
</image>
</view>
</view>
</view>
<view class="containertop">
<view class="containertopbox">
<view class="containertopboxone flex-start">
<view>可使用红包</view>
<view>200</view>
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
<view class="containertopboxitemleft flex-colum"
:class="item.status == 0?'':'containertopboxitemlefts'">
<view class="containertopboxitemleft_one"
:class="item.status == 0?'':'containertopboxitemleft_ones'">
<text style="font-size: 28rpx;"></text>
<text>{{item.couponsAmount || 0}}</text>
</view>
<view class="containertopboxitemleft_tow"
:class="item.status == 0?'':'containertopboxitemleft_tows'">
优惠券()
</view>
</view>
<view class="containertopboxitemright">
<view class="containertopboxitemright_one">
无门槛使用
</view>
<view class="containertopboxitemright_tow">
通用红包券
</view>
<view class="containertopboxitemright_there">
有效期至{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
</view>
<view
:class="item.status == 0?'containertopboxitemright_four':'containertopboxitemright_fours'">
{{item.status == 0 ? '兑换积分':'已过期'}}
</view>
</view>
</view>
<u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' />
</view>
</view>
</view>
@@ -14,33 +52,295 @@
<script>
export default {
data() {
return {};
return {
listbox: [{
name: '全部',
type: ''
},
{
name: '未使用',
type: '0'
},
{
name: '已过期',
type: '1'
}
],
towcontentclickindex: 0,
list: [],
form: {
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
statuses: ''
},
};
},
onLoad() {
this.ordermineCouponsthis()
},
onReachBottom() {
this.ordermineCouponsthis()
},
methods: {
init_fn(e) {
this.list = []
this.form = {
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
statuses: ''
}
try {
if (e) {
this.form.statuses = e
}
} catch (e) {
//TODO handle the exception
}
this.ordermineCouponsthis()
},
async ordermineCouponsthis() {
try {
let res = await this.api.ordermineCoupons({
userId: uni.cache.get('userInfo').id,
status: this.form.statuses,
page: this.form.page,
size: this.form.size
})
if (res.data.pages < this.form.page) {
this.form.status = 'nomore'
return false;
} else {
this.form.status = 'loading';
this.form.page = ++this.form.page;
setTimeout(() => {
this.list = [...this.list, ...res.data.list];
this.form.status = 'loading';
if (res.data.pageNum == res.data.pages) {
this.form.status = 'nomore';
} else {
this.form.status = 'loading';
}
}, 500)
}
} catch (e) {
//TODO handle the exception
}
},
towcontentclick(index, item) {
this.towcontentclickindex = index
this.form.statuses = item.type
this.init_fn(item.type)
}
}
};
</script>
<style scoped lang="scss">
.container {
.containertop {
padding: 48rpx 32rpx;
page {
background: #fff;
}
.containertopbox {
.containertopboxone{
view{
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
text{
margin-left: 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #666666;
.container {
.towcontent {
padding: 0 28rpx;
border-top: 16rpx solid #F9F9F9;
.towcontentlistxitem {
width: 100%;
margin-top: 32rpx;
.towcontentlistxitembox {
width: 33%;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #333333;
image {
margin-top: 6rpx;
width: 38.83rpx;
height: 8.62rpx;
}
}
.towcontentlistxitemboxopacity {
width: 33%;
font-family: PingFang SC, PingFang SC;
font-weight: bold;
font-size: 32rpx;
color: #333333;
image {
width: 38.83rpx;
height: 8.62rpx;
}
}
}
}
.containertop {
padding: 40rpx 32rpx;
.containertopbox {
.containertopboxitem::after {
position: absolute;
bottom: 14rpx;
left: 14rpx;
content: '';
display: inline-block;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/coupontop.png) no-repeat;
width: 72.83rpx;
height: 77.14rpx;
background-size: cover;
}
.containertopboxitem {
margin-top: 20rpx;
width: 100%;
position: relative;
.containertopboxitemleft {
position: relative;
width: 182rpx;
height: 192rpx;
background: #F1CB66;
border-radius: 18rpx 0rpx 0rpx 18rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
::after {
content: '';
position: absolute;
top: 0rpx;
left: 166rpx;
background: #f9f9f9;
display: inline-block;
width: 32rpx;
height: 16rpx;
border-radius: 0 0 32rpx 32rpx;
z-index: 999;
}
::before {
content: '';
position: absolute;
bottom: 0rpx;
left: 166rpx;
background: #f9f9f9;
display: inline-block;
width: 32rpx;
height: 16rpx;
line-height: 32rpx;
border-radius: 32rpx 32rpx 0 0;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
z-index: 999;
}
.containertopboxitemleft_one {
text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 60rpx;
color: #FFFFFF;
}
}
.containertopboxitemleft_ones {
text {
color: #999999;
}
}
.containertopboxitemleft_tow {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
}
.containertopboxitemleft_tows {
color: #999999;
}
}
.containertopboxitemlefts {
background: #F7F7F7;
}
.containertopboxitemright {
position: relative;
padding: 0 32rpx;
flex: auto;
height: 192rpx;
background: #FFFFFF;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
border-radius: 0rpx 18rpx 18rpx 0rpx;
.containertopboxitemright_one {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #666666;
padding: 12rpx 0;
border-bottom: 1rpx dotted #707070;
}
.containertopboxitemright_tow {
margin-top: 14rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.containertopboxitemright_there {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #999999;
}
.containertopboxitemright_four {
position: absolute;
right: 32rpx;
top: 50%;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
padding: 0 14rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: #FE665E;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
.containertopboxitemright_fours {
position: absolute;
right: 32rpx;
top: 50%;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #999999;
padding: 0 14rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: #F7F7F7;
border-radius: 24rpx 24rpx 24rpx 24rpx;
}
}
}
}
}
}
</style>

View File

@@ -51,7 +51,7 @@
</view>
</view>
<view class="order-menu">
<navigator class="item" hover-class="none" url="/pages/user/coupon">
<navigator class="item" hover-class="none" url="/pages/order/successful">
<!-- <image class="icon" src="@/static/user_icon5.png" mode="aspectFit"></image> -->
<text class="t">优惠券</text>
</navigator>