确认订单页面及收银台页面调整

This commit is contained in:
2022-06-08 14:13:33 +08:00
parent ad9d27ccc1
commit 803d3af3cb
15 changed files with 6506 additions and 6473 deletions

View File

@@ -10,8 +10,8 @@ import router from '../router'
// 基础配置
const config = {
apiUrl : 'http://api.gl.shangkelian.cn/api/', // 正式环境
// apiUrl : 'http://api.zh.shangkelian.cn/api/', // 大健康调试环境,目前没有任何数据无法正常显示,所以需要使用该环境,最后会删除
// apiUrl : 'http://api.gl.shangkelian.cn/api/', // 正式环境
apiUrl : 'http://api.zh.shangkelian.cn/api/', // 大健康调试环境,目前没有任何数据无法正常显示,所以需要使用该环境,最后会删除
timeout : 60000
}

View File

@@ -96,7 +96,7 @@
"path": "pages/order/index",
"name": "Order",
"style": {
"navigationBarTitleText": "订单",
"navigationBarTitleText": "我的订单",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}

View File

@@ -1,104 +1,121 @@
<template>
<view>
<oct-pay
:price="price"
:payNo="payNo"
color="#34CE98"
price-color="#e6576b"
:payPlatform="platform"
@onPay="pay"
/>
</view>
<view>
<oct-pay :price="price" :payNo="payNo" color="#34CE98" price-color="#e6576b" :payPlatform="platform"
@onPay="pay" />
</view>
</template>
<script>
import { wxPAY, alPAY } from '@/apis/interfaces/pay'
export default {
data() {
return {
payNo : "",
price : "",
platform: ['wxpay', 'alipay']
}
},
mounted() {
this.payNo = this.$Route.query.orderNo
this.price = Number(this.$Route.query.price).toFixed(2)
},
methods: {
pay(e){
uni.getProvider({
service: 'payment',
success: res => {
if(res.provider.findIndex(val => val === e.platform) < 0){
switch (e.platform){
case 'wxpay':
uni.showToast({
title: '支付失败,您暂未安装微信',
icon : 'none'
})
break;
case 'alipay':
uni.showToast({
title: '支付失败,您暂未安装支付宝',
icon : 'none'
})
break;
}
return
}
if(e.platform === 'wxpay') this.getWXPAY(e.platform)
if(e.platform === 'alipay') this.getALPAY(e.platform)
}
})
},
getALPAY(payType){
alPAY(this.payNo).then(res => {
this.callPay(res, payType)
})
},
getWXPAY(payType){
wxPAY(this.payNo).then(res => {
let config = JSON.parse(res)
this.callPay(config, payType)
})
},
callPay(orderInfo, payType){
uni.requestPayment({
provider: payType,
orderInfo,
success: payRes => {
uni.showModal({
title: '支付成功',
content: '订单已支付,我们将尽快为您安排发货,可在订单管理查询订单动态',
showCancel:false,
success:onRes => {
if(onRes.confirm){
if(this.$Route.query.oepnType === 'order'){
this.$store.commit('setRefresh', 1)
}
this.$Router.back()
}
}
})
},
fail: payErr => {
if(payErr.errCode == '-100'){
uni.showToast({
title: '支付被取消',
icon : 'none'
})
}else{
uni.showToast({
title: payErr.errMsg,
icon : 'none'
})
}
}
})
}
}
}
import {
wxPAY,
alPAY
} from '@/apis/interfaces/pay'
export default {
data() {
return {
payNo: "",
price: "",
platform: ['dtpay']
}
},
mounted() {
this.payNo = this.$Route.query.orderNo
this.price = Number(this.$Route.query.price).toFixed(2)
},
methods: {
pay(e) {
if (e.platform === 'dtpay') return this.getDTPAY(e.platform);
uni.getProvider({
service: 'payment',
success: res => {
if (res.provider.findIndex(val => val === e.platform) < 0) {
switch (e.platform) {
case 'wxpay':
uni.showToast({
title: '支付失败,您暂未安装微信',
icon: 'none'
})
break;
case 'alipay':
uni.showToast({
title: '支付失败,您暂未安装支付宝',
icon: 'none'
})
break;
}
return
}
if (e.platform === 'wxpay') this.getWXPAY(e.platform)
if (e.platform === 'alipay') this.getALPAY(e.platform)
}
})
},
getDTPAY(){
console.log('dt 支付。。。')
uni.showModal({
title:'当前DT积分不足',
content:'不能支付该订单,是否放弃当前支付',
confirmText:'立即充值',
confirmColor:"#34CE98",
cancelText:'放弃支付',
cancelColor:"#666666",
success: (res) => {
if(res.confirm){
}else{
uni.navigateBack();
}
}
})
},
getALPAY(payType) {
alPAY(this.payNo).then(res => {
this.callPay(res, payType)
})
},
getWXPAY(payType) {
wxPAY(this.payNo).then(res => {
let config = JSON.parse(res)
this.callPay(config, payType)
})
},
callPay(orderInfo, payType) {
uni.requestPayment({
provider: payType,
orderInfo,
success: payRes => {
uni.showModal({
title: '支付成功',
content: '订单已支付,我们将尽快为您安排发货,可在订单管理查询订单动态',
showCancel: false,
success: onRes => {
if (onRes.confirm) {
if (this.$Route.query.oepnType === 'order') {
this.$store.commit('setRefresh', 1)
}
this.$Router.back()
}
}
})
},
fail: payErr => {
if (payErr.errCode == '-100') {
uni.showToast({
title: '支付被取消',
icon: 'none'
})
} else {
uni.showToast({
title: payErr.errMsg,
icon: 'none'
})
}
}
})
}
}
}
</script>
<style>

View File

@@ -21,7 +21,7 @@
<image class="order-cover" :src="item.items[0].cover" mode="aspectFill"></image>
<view class="order-title">{{item.items[0].title}}</view>
<view class="order-count">
<view class="order-price"><text></text>{{item.items[0].price}}</view>
<view class="order-price">{{item.items[0].price}}<text class="type">DT积分</text></view>
</view>
</view>
</block>
@@ -44,12 +44,12 @@
<view class="block info-box">
<view class="info-item">
<view class="label">订单备注</view>
<textarea class="info-textarea" v-model="remark" placeholder="订单备注"></textarea>
<textarea class="info-textarea" v-model="remark" placeholder="请输入备注"></textarea>
</view>
</view>
<!-- footer -->
<view class="order-footer">
<view class="total">总计<text>{{total}}</text></view>
<view class="total">总计<text>{{total}} <text class="type">DT积分</text></text></view>
<button class="btn" @click="subOrder">确认订单</button>
</view>
</view>
@@ -217,13 +217,17 @@
padding-left: $margin;
line-height: 40rpx;
.order-price{
font-size: 30rpx;
font-size: 32rpx;
font-weight: bold;
color: $text-price;
&>text{
font-size: 24rpx;
}
}
.type{
font-size: 22rpx;
padding-left: 6rpx;
}
.order-sum{
font-size: $title-size-sm;
color: $text-gray;
@@ -289,6 +293,10 @@
font-size: $title-size-lg;
font-weight: bold;
}
.type{
font-size: 22rpx;
padding-left: 6rpx;
}
}
.btn{
margin-left: $margin;

View File

@@ -61,7 +61,7 @@
</view>
<!-- 订单 -->
<view class="order-box">
<view class="order-box-item" @click="onBtn('Order', { index: 4 })">
<view class="order-box-item" @click="onBtn('Order', { index: 0 })">
<image class="icon" src="@/static/user/order_icon_04.png" mode="widthFix" />
<view class="title">我的订单</view>
</view>

BIN
uni_modules/oct-pay/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -30,6 +30,15 @@
<radio value="alipay" :checked="payIndex === 0" :color="color" />
</label>
</view>
<view class="radio--item" v-if="pay === 'dtpay'">
<label class="radio-flex">
<view class="radio--text">
<image class="radio--icon" src="../../static/dtpay.png" mode="widthFix"></image>
DT积分
</view>
<radio value="alipay" :checked="payIndex === 0" :color="color" />
</label>
</view>
</block>
</radio-group>
<!-- 提交支付 -->
@@ -77,7 +86,8 @@
payPlatform: {
type: Array,
default: ()=> {
return ["wxpay", "alipay"]
return ["dtpay"];
// return ["wxpay", "alipay","dtpay"];
}
},
// 支付编号
@@ -170,7 +180,7 @@
}
}
&>.footer{
margin-top: $margin;
margin-top: $margin * 4;
.footer--pay{
height: 90rpx;
line-height: 90rpx;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@
var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/auth/auth","pages/auth/role","pages/life/life","pages/store/index","pages/user/index","pages/setting/setting","pages/store/goods","pages/store/buy","pages/order/index","pages/order/details","pages/address/index","pages/address/edit","pages/pay/pay","pages/store/list","pages/store/meals","pages/store/search","pages/refund/index","pages/account/integral","pages/account/dt","pages/account/recharge","pages/vip/vip","pages/vip/agreement","pages/store/shop/shopDetail","pages/store/shop/shopList"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"ZH健康","navigationBarBackgroundColor":"#F3F6FB","backgroundColorTop":"#F3F6FB","backgroundColorBottom":"#F3F6FB"},"tabBar":{"borderStyle":"white","selectedColor":"#34CE98","list":[{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/life/life","text":"共力人生"},{"iconPath":"static/tabBar/tabBar_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png","pagePath":"pages/store/index","text":"DT商城"},{"iconPath":"static/tabBar/tabBar_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png","pagePath":"pages/user/index","text":"我的"}]},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"ZH-HEALTH","compilerVersion":"3.3.11","entryPagePath":"pages/auth/auth","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/auth/auth","meta":{"isQuit":true},"window":{"navigationBarTitleText":"登录","navigationStyle":"custom"}},{"path":"/pages/auth/role","meta":{},"window":{"navigationBarTitleText":"角色创建","navigationBarBackgroundColor":"#FFF","titleNView":{"buttons":[{"text":"退出登录","fontSize":"14","width":"80px","color":"#34CE98"}]}}},{"path":"/pages/life/life","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"共力人生","navigationStyle":"custom"}},{"path":"/pages/store/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"DT商城","enablePullDownRefresh":true,"titleNView":{"backgroundColor":"#FFFFFF","buttons":[{"float":"right","text":"","fontSrc":"/static/iconfont.ttf","color":"#000","fontSize":"20px"}]}}},{"path":"/pages/user/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的","navigationStyle":"custom"}},{"path":"/pages/setting/setting","meta":{},"window":{"navigationBarTitleText":"设置中心","navigationBarBackgroundColor":"#34CE98","navigationBarTextStyle":"white"}},{"path":"/pages/store/goods","meta":{},"window":{"navigationStyle":"custom","navigationBarTitleText":"详情","titleNView":{"backgroundColor":"#FFFFFF","type":"transparent"}}},{"path":"/pages/store/buy","meta":{},"window":{"navigationBarTitleText":"确认订单","enablePullDownRefresh":false}},{"path":"/pages/order/index","meta":{},"window":{"navigationBarTitleText":"订单","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/order/details","meta":{},"window":{"navigationBarTitleText":"订单详情","enablePullDownRefresh":false}},{"path":"/pages/address/index","meta":{},"window":{"navigationBarTitleText":"收货地址"}},{"path":"/pages/address/edit","meta":{},"window":{"navigationBarTitleText":"编辑","enablePullDownRefresh":false}},{"path":"/pages/pay/pay","meta":{},"window":{"navigationBarTitleText":"收银台","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/store/list","meta":{},"window":{"navigationBarTitleText":"商品","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}},{"path":"/pages/store/meals","meta":{},"window":{"navigationBarTitleText":"套餐","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}},{"path":"/pages/store/search","meta":{},"window":{"navigationBarTitleText":"搜索","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/refund/index","meta":{},"window":{"navigationBarTitleText":"退换货","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/account/integral","meta":{},"window":{"navigationBarTitleText":"共力值","navigationBarBackgroundColor":"#34CE98","navigationBarTextStyle":"white"}},{"path":"/pages/account/dt","meta":{},"window":{"navigationBarTitleText":"DT积分","navigationBarBackgroundColor":"#34CE98","backgroundColorTop":"#34CE98","navigationBarTextStyle":"white","titleNView":{"buttons":[{"text":"充值","width":"60","fontSize":"14","fontWeight":"bold"}]}}},{"path":"/pages/account/recharge","meta":{},"window":{"navigationBarTitleText":"DT积分充值","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/vip/vip","meta":{},"window":{"navigationBarTitleText":"共力会员","navigationBarBackgroundColor":"#242430","navigationBarTextStyle":"white","backgroundColorTop":"#242430"}},{"path":"/pages/vip/agreement","meta":{},"window":{"navigationBarTitleText":"共力会员协议"}},{"path":"/pages/store/shop/shopDetail","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/store/shop/shopList","meta":{},"window":{"navigationBarTitleText":"更多店铺","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}}];
var __uniRoutes = [{"path":"/pages/auth/auth","meta":{"isQuit":true},"window":{"navigationBarTitleText":"登录","navigationStyle":"custom"}},{"path":"/pages/auth/role","meta":{},"window":{"navigationBarTitleText":"角色创建","navigationBarBackgroundColor":"#FFF","titleNView":{"buttons":[{"text":"退出登录","fontSize":"14","width":"80px","color":"#34CE98"}]}}},{"path":"/pages/life/life","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"共力人生","navigationStyle":"custom"}},{"path":"/pages/store/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"DT商城","enablePullDownRefresh":true,"titleNView":{"backgroundColor":"#FFFFFF","buttons":[{"float":"right","text":"","fontSrc":"/static/iconfont.ttf","color":"#000","fontSize":"20px"}]}}},{"path":"/pages/user/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的","navigationStyle":"custom"}},{"path":"/pages/setting/setting","meta":{},"window":{"navigationBarTitleText":"设置中心","navigationBarBackgroundColor":"#34CE98","navigationBarTextStyle":"white"}},{"path":"/pages/store/goods","meta":{},"window":{"navigationStyle":"custom","navigationBarTitleText":"详情","titleNView":{"backgroundColor":"#FFFFFF","type":"transparent"}}},{"path":"/pages/store/buy","meta":{},"window":{"navigationBarTitleText":"确认订单","enablePullDownRefresh":false}},{"path":"/pages/order/index","meta":{},"window":{"navigationBarTitleText":"我的订单","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":false}},{"path":"/pages/order/details","meta":{},"window":{"navigationBarTitleText":"订单详情","enablePullDownRefresh":false}},{"path":"/pages/address/index","meta":{},"window":{"navigationBarTitleText":"收货地址"}},{"path":"/pages/address/edit","meta":{},"window":{"navigationBarTitleText":"编辑","enablePullDownRefresh":false}},{"path":"/pages/pay/pay","meta":{},"window":{"navigationBarTitleText":"收银台","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/store/list","meta":{},"window":{"navigationBarTitleText":"商品","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}},{"path":"/pages/store/meals","meta":{},"window":{"navigationBarTitleText":"套餐","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}},{"path":"/pages/store/search","meta":{},"window":{"navigationBarTitleText":"搜索","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/refund/index","meta":{},"window":{"navigationBarTitleText":"退换货","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/account/integral","meta":{},"window":{"navigationBarTitleText":"共力值","navigationBarBackgroundColor":"#34CE98","navigationBarTextStyle":"white"}},{"path":"/pages/account/dt","meta":{},"window":{"navigationBarTitleText":"DT积分","navigationBarBackgroundColor":"#34CE98","backgroundColorTop":"#34CE98","navigationBarTextStyle":"white","titleNView":{"buttons":[{"text":"充值","width":"60","fontSize":"14","fontWeight":"bold"}]}}},{"path":"/pages/account/recharge","meta":{},"window":{"navigationBarTitleText":"DT积分充值","navigationBarBackgroundColor":"#FFFFFF"}},{"path":"/pages/vip/vip","meta":{},"window":{"navigationBarTitleText":"共力会员","navigationBarBackgroundColor":"#242430","navigationBarTextStyle":"white","backgroundColorTop":"#242430"}},{"path":"/pages/vip/agreement","meta":{},"window":{"navigationBarTitleText":"共力会员协议"}},{"path":"/pages/store/shop/shopDetail","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/store/shop/shopList","meta":{},"window":{"navigationBarTitleText":"更多店铺","navigationBarBackgroundColor":"#FFFFFF","enablePullDownRefresh":true}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long