Browse Source

2023-3-3

功能完善 微信支付
master
guoxing 2 years ago
parent
commit
322aaf3b44
  1. 2
      mallplusui-uniapp-app/common/api.js
  2. 23
      mallplusui-uniapp-app/components/payments/paymentsByApp.vue
  3. BIN
      mallplusui-uniapp-app/docs/pyw_app_key.jks
  4. 13
      mallplusui-uniapp-app/docs/签名密码及第三方登录信息.txt
  5. 10
      mallplusui-uniapp-app/manifest.json
  6. 200
      mallplusui-uniapp-app/pages/order/order.vue
  7. 74
      mallplusui-uniapp-app/pages/order/orderDetail.vue

2
mallplusui-uniapp-app/common/api.js

@ -1,7 +1,7 @@
import store from '../store/index'; import store from '../store/index';
export default { export default {
// qq 237524947 wx15d4269d3210863d // qq 237524947 wx15d4269d3210863d
// BASEURI: 'http://2xpk7t.natappfree.cc/api/', // BASEURI: 'http://2wsiyd.natappfree.cc/api/',
BASEURI: 'http://mall.yyundong.com/portalapi/api/', BASEURI: 'http://mall.yyundong.com/portalapi/api/',
// BASEURI: 'http://192.168.31.52:8083/api/', // BASEURI: 'http://192.168.31.52:8083/api/',
ADMINURI: 'http://mall.yyundong.com/adminapi/', ADMINURI: 'http://mall.yyundong.com/adminapi/',

23
mallplusui-uniapp-app/components/payments/paymentsByApp.vue

@ -1,6 +1,7 @@
<template> <template>
<view class="pay-type-list"> <view class="pay-type-list">
<view class="type-item b-b" v-for="item in paymentss" :key="item.code" @click="toPayHandler(item.code)" v-if="!(type == 2 && item.code == 'balancepay')"> <view class="type-item b-b" v-for="item in paymentss" :key="item.code" @click="toPayHandler(item.code)"
v-if="!(type == 2 && item.code == 'balancepay')">
<text v-if="item.code == 'wechatpay'" class="icon yticon icon-weixinzhifu"></text> <text v-if="item.code == 'wechatpay'" class="icon yticon icon-weixinzhifu"></text>
<text v-if="item.code == 'alipay'" class="icon yticon icon-alipay"></text> <text v-if="item.code == 'alipay'" class="icon yticon icon-alipay"></text>
<text v-if="item.code == 'offline'" class="icon yticon icon-weixinzhifu"></text> <text v-if="item.code == 'offline'" class="icon yticon icon-weixinzhifu"></text>
@ -80,7 +81,9 @@ export default {
// //
async toPayHandler(code) { async toPayHandler(code) {
let _this = this; let _this = this;
let params = { orderId: this.orderId }; let params = {
orderId: this.orderId
};
let data = { let data = {
payment_code: code, payment_code: code,
payment_type: _this.type payment_type: _this.type
@ -110,17 +113,20 @@ export default {
} }
let res = await Api.apiCall('get', Api.order.aliAppPay, params); let res = await Api.apiCall('get', Api.order.aliAppPay, params);
console.log("aliAppPay》》》", res);
if (res) { if (res) {
console.log(res); console.log(res);
uni.requestPayment({ uni.requestPayment({
provider: 'alipay', provider: 'alipay',
orderInfo: res, orderInfo: res,
success: function(data) { success: function(data) {
console.log("aliAppPay_data》》》", data);
let rawdataResult = JSON.parse(data.rawdata).result; let rawdataResult = JSON.parse(data.rawdata).result;
let r = rawdataResult.split(';')[0]; let r = rawdataResult.split(';')[0];
let r1 = rawdataResult.split(';')[0].length - 1; let r1 = rawdataResult.split(';')[0].length - 1;
let r2 = rawdataResult.split(';')[0].length - 2; let r2 = rawdataResult.split(';')[0].length - 2;
let alipayTradeAppPayResponse = JSON.parse(r.substr(0, r1)).alipay_trade_app_pay_response; let alipayTradeAppPayResponse = JSON.parse(r.substr(0, r1))
.alipay_trade_app_pay_response;
let out_trade_no = alipayTradeAppPayResponse.out_trade_no; let out_trade_no = alipayTradeAppPayResponse.out_trade_no;
_this.$common.successToShow('支付成功', () => { _this.$common.successToShow('支付成功', () => {
//_this.redirectHandler(res.data.payment_id) //_this.redirectHandler(res.data.payment_id)
@ -177,7 +183,9 @@ export default {
* 用户余额支付 * 用户余额支付
* *
*/ */
let params1 = { orderId: this.orderId }; let params1 = {
orderId: this.orderId
};
let data1 = await Api.apiCall('post', Api.order.balancePay, params1); let data1 = await Api.apiCall('post', Api.order.balancePay, params1);
console.log(data1); console.log(data1);
if (data1) { if (data1) {
@ -222,6 +230,7 @@ export default {
font-size: 50upx; font-size: 50upx;
color: #303133; color: #303133;
margin-top: 12upx; margin-top: 12upx;
&:before { &:before {
content: '¥'; content: '¥';
font-size: 40upx; font-size: 40upx;
@ -249,20 +258,25 @@ export default {
width: 100upx; width: 100upx;
font-size: 52upx; font-size: 52upx;
} }
.icon-erjiye-yucunkuan { .icon-erjiye-yucunkuan {
color: #fe8e2e; color: #fe8e2e;
} }
.icon-weixinzhifu { .icon-weixinzhifu {
color: #36cb59; color: #36cb59;
} }
.icon-alipay { .icon-alipay {
color: #01aaef; color: #01aaef;
} }
.tit { .tit {
font-size: $font-lg; font-size: $font-lg;
color: $font-color-dark; color: $font-color-dark;
margin-bottom: 4upx; margin-bottom: 4upx;
} }
.con { .con {
flex: 1; flex: 1;
display: flex; display: flex;
@ -271,6 +285,7 @@ export default {
color: $font-color-light; color: $font-color-light;
} }
} }
.mix-btn { .mix-btn {
display: flex; display: flex;
align-items: center; align-items: center;

BIN
mallplusui-uniapp-app/docs/pyw_app_key.jks

Binary file not shown.

13
mallplusui-uniapp-app/docs/签名密码及第三方登录信息.txt

@ -0,0 +1,13 @@
签名密码及第三方登录信息
证书别名:key0
证书签名的密码:yxt123
QQ登录的
APP ID:101453048
APP Key:80382d6bd51922ef10a182f69b84581d
审核通过
微信
AppID: wxc46a728ab3aae3c0
AppSecret: 85f3970bdfba3d7d01fdd82bc370aeec

10
mallplusui-uniapp-app/manifest.json

@ -2,8 +2,8 @@
"name" : "汇融云链", "name" : "汇融云链",
"appid" : "__UNI__FB2C9C4", "appid" : "__UNI__FB2C9C4",
"description" : "", "description" : "",
"versionName" : "1.0.0.3", "versionName" : "1.0.0.5",
"versionCode" : 1003, "versionCode" : 1005,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"usingComponents" : true, "usingComponents" : true,
@ -63,7 +63,7 @@
"sdkConfigs" : { "sdkConfigs" : {
"oauth" : { "oauth" : {
"weixin" : { "weixin" : {
"appid" : "wx04b09a8148e4875c", "appid" : "wxa66597d50184d027",
"appsecret" : "3526ec2107c123f59b5c1cb7ff23a252", "appsecret" : "3526ec2107c123f59b5c1cb7ff23a252",
"UniversalLinks" : "" "UniversalLinks" : ""
}, },
@ -73,7 +73,7 @@
}, },
"payment" : { "payment" : {
"weixin" : { "weixin" : {
"appid" : "wx04b09a8148e4875c", "appid" : "wxa66597d50184d027",
"UniversalLinks" : "", "UniversalLinks" : "",
"__platform__" : [ "android" ] "__platform__" : [ "android" ]
}, },
@ -91,7 +91,7 @@
"ad" : {}, "ad" : {},
"share" : { "share" : {
"weixin" : { "weixin" : {
"appid" : "wx04b09a8148e4875c", "appid" : "wxa66597d50184d027",
"UniversalLinks" : "" "UniversalLinks" : ""
}, },
"qq" : { "qq" : {

200
mallplusui-uniapp-app/pages/order/order.vue

@ -1,12 +1,13 @@
<template> <template>
<view class="content"> <view class="content">
<view class="navbar"> <view class="navbar">
<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view> <view v-for="(item, index) in navList" :key="index" class="nav-item"
:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
</view> </view>
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab"> <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"> <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData"> <scroll-view class="list-scroll-content" scroll-y>
<!-- 空白页 --> <!-- 空白页 -->
<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
@ -15,60 +16,83 @@
<view class="i-top b-b"> <view class="i-top b-b">
<text class="time" @click="navToDetailPage(item)">{{ item.createTime }}</text> <text class="time" @click="navToDetailPage(item)">{{ item.createTime }}</text>
<!-- <text class="state" :style="{ color: item.stateTipColor }" @click="navToDetailPage(item)">{{ item.id }}</text> --> <!-- <text class="state" :style="{ color: item.stateTipColor }" @click="navToDetailPage(item)">{{ item.id }}</text> -->
<text class="state" :style="{ color: item.stateTipColor }" @click="navToDetailPage(item)">{{ item.stateTip }}</text> <text class="state" :style="{ color: item.stateTipColor }"
<text v-if="item.status === 12" class="del-btn yticon icon-iconfontshanchu1" @click="deleteOrder(index)"></text> @click="navToDetailPage(item)">{{ item.stateTip }}</text>
<text v-if="item.status === 12" class="del-btn yticon icon-iconfontshanchu1"
@click="deleteOrder(index)"></text>
</view> </view>
<scroll-view v-if="item.orderItemList.length > 1" class="goods-box" scroll-y> <scroll-view v-if="item.orderItemList.length > 1" class="goods-box" scroll-y>
<view v-for="(goodsItem, goodsIndex) in item.orderItemList" :key="goodsIndex" class="goods-item"> <view v-for="(goodsItem, goodsIndex) in item.orderItemList" :key="goodsIndex"
<img class="goods-img" :src="goodsItem.productPic" @click="navToDetailPage(item)" mode="aspectFill" /> class="goods-item">
<img class="goods-img" :src="goodsItem.productPic" @click="navToDetailPage(item)"
mode="aspectFill" />
</view> </view>
</scroll-view> </scroll-view>
<view v-if="item.orderItemList.length === 1" class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.orderItemList" :key="goodsIndex"> <view v-if="item.orderItemList.length === 1" class="goods-box-single"
v-for="(goodsItem, goodsIndex) in item.orderItemList" :key="goodsIndex">
<img class="goods-img" :src="goodsItem.productPic" mode="aspectFill" /> <img class="goods-img" :src="goodsItem.productPic" mode="aspectFill" />
<view class="right" @click="navToDetailPage(item)"> <view class="right" @click="navToDetailPage(item)">
<text class="title clamp">{{ goodsItem.productName }}</text> <text class="title clamp">{{ goodsItem.productName }}</text>
<text class="attr-box">{{ goodsItem.productAttr }} x {{ goodsItem.productQuantity }}</text> <view class="num_price">
<text class="price">{{ goodsItem.productPrice }}</text><br/> <text class="attr-box">x {{ goodsItem.productQuantity }}</text>
<!-- <text class="title clamp" v-if="item.status === 5">{{ item.deliveryCompany }}:{{ item.deliverySn }}</text> <text class="price">{{ goodsItem.productPrice }}</text>
<text class="title clamp" v-if="item.status === 3">{{ item.deliveryCompany }}:{{ item.deliverySn }}</text> -->
</view>
</view> </view>
</view>
</view>
<view style="display: flex;flex-direction: row;margin-right: 13px;margin-bottom: 10px;">
<!-- <image v-if="item.status === 5||item.status === 3" style="width: 20px;height: 20px;"
src="/static/temp//orderId.png"></image> -->
<text style="margin-left: 5px;color: #c1c1c1;font-size: 13px;"
v-if="item.status === 5||item.status === 3">{{item.deliveryCompany}}</text>
<text style="margin-left: 5px;color: #c1c1c1;font-size: 13px;"
v-if="item.status === 5||item.status === 3">{{ item.deliverySn }}</text>
<view class="price-box"> <view class="price-box">
<text class="num">{{ item.orderItemList.length }}</text> <text class="num">{{ item.orderItemList.length }}</text>
件商品 实付款 件商品 实付款
<text class="price">{{ item.payAmount }}</text> <text class="price">{{ item.payAmount }}</text>
</view> </view>
<view class="action-box b-t"> </view>
<view class="action-box b-t" v-if="item.status==12||item.status==3">
<!-- <text class="state" :style="{ color: item.stateTipColor }" v-if="item.orderType == 1">正常订单</text>
<text class="state" :style="{ color: item.stateTipColor }" v-if="item.orderType == 6">秒杀订单</text> <text class="state" :style="{ color: item.stateTipColor }" v-if="item.orderType == 6">秒杀订单</text>
<text class="state" :style="{ color: item.stateTipColor }" v-else-if="item.orderType == 2">拼团订单</text> <text class="state" :style="{ color: item.stateTipColor }" v-else-if="item.orderType == 2">拼团订单</text>
<text class="state" :style="{ color: item.stateTipColor }" v-else-if="item.orderType == 3">团购订单</text> <text class="state" :style="{ color: item.stateTipColor }" v-else-if="item.orderType == 3">团购订单</text>
<text class="state" :style="{ color: item.stateTipColor }" v-else-if="item.orderType == 4">砍价订单</text> <text class="state" :style="{ color: item.stateTipColor }" v-else-if="item.orderType == 4">砍价订单</text>
<text class="state" :style="{ color: item.stateTipColor }" v-else-if="item.orderType == 5">积分订单</text> <text class="state" :style="{ color: item.stateTipColor }" v-else-if="item.orderType == 5">积分订单</text> -->
<button v-if="item.status == 12" class="action-btn" @click="cancelOrder(item)">取消订单</button> <button v-if="item.status == 12" class="action-btn" @click="cancelOrder(item)">取消订单</button>
<button v-if="item.status == 12" class="action-btn recom" @click="payOrder(item)">立即支付</button> <button v-if="item.status == 12" class="action-btn recom"
@click="payOrder(item)">立即支付</button>
<!-- <button v-if="item.status > 2 && item.status < 10" class="action-btn recom" @click="lookLogistics(item.id)">物流追踪</button> --> <!-- <button v-if="item.status > 2 && item.status < 10" class="action-btn recom" @click="lookLogistics(item.id)">物流追踪</button> -->
<button v-if="item.status < 5" class="action-btn recom" @click="applyRefund(item.id)">申请售后</button> <!-- <button v-if="item.status < 5" class="action-btn recom" @click="applyRefund(item.id)">申请售后</button> -->
<button v-if="item.status == 3" class="action-btn recom" @click="confimDelivery(item)">确认收货</button> <button v-if="item.status == 3" class="action-btn recom"
@click="confimDelivery(item)">确认收货</button>
<!-- <button class="action-btn recom" hover-class="btn-hover" v-if="item.status === 4" @click="toEvaluate(item.id)">立即评价</button> --> <!-- <button class="action-btn recom" hover-class="btn-hover" v-if="item.status === 4" @click="toEvaluate(item.id)">立即评价</button> -->
</view> </view>
</view> </view>
<uni-load-more :status="loadingType"></uni-load-more>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<uni-load-more :status="loadingType"></uni-load-more>
</view> </view>
</template> </template>
<script> <script>
import { mapState } from 'vuex'; import {
mapState
} from 'vuex';
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue'; import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
import Api from '@/common/api'; import Api from '@/common/api';
import uniLoadMore from '@/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue'; import uniLoadMore from '@/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue';
import empty from '@/components/empty'; import empty from '@/components/empty';
import { formatDate } from '@/common/date'; import {
formatDate
} from '@/common/date';
export default { export default {
components: { components: {
mallplusCopyright, mallplusCopyright,
@ -79,39 +103,37 @@ export default {
return { return {
tabCurrentIndex: 0, tabCurrentIndex: 0,
pageNum: 1, pageNum: 1,
orderList: [],
headerPosition: 'fixed', headerPosition: 'fixed',
headerTop: '0px', headerTop: '0px',
loadingType: 'loading', // loadingType: 'more', //
navList: [ navList: [{
{
status: 0, status: 0,
text: '全部', text: '全部',
loadingType: 'loading', loadingType: 'more',
orderList: [] orderList: []
}, },
{ {
status: 12, status: 12,
text: '待付款', text: '待付款',
loadingType: 'loading', loadingType: 'more',
orderList: [] orderList: []
}, },
{ {
status: 2, status: 2,
text: '待发货', text: '待发货',
loadingType: 'loading', loadingType: 'more',
orderList: [] orderList: []
}, },
{ {
status: 3, status: 3,
text: '已发货', text: '已发货',
loadingType: 'loading', loadingType: 'more',
orderList: [] orderList: []
}, },
{ {
status: 5, status: 5,
text: '已完成', text: '已完成',
loadingType: 'loading', loadingType: 'more',
orderList: [] orderList: []
} }
] ]
@ -139,11 +161,22 @@ export default {
onPullDownRefresh() { onPullDownRefresh() {
this.pageNum = 1; this.pageNum = 1;
this.loadData('refresh'); this.loadData('refresh');
setTimeout(function() {
uni.stopPullDownRefresh();
}, 2000);
},
onShow() {
this.pageNum = 1;
this.loadData('refresh');
setTimeout(function() {
uni.stopPullDownRefresh();
}, 2000);
}, },
// //
onReachBottom() { onReachBottom() {
this.pageNum = this.pageNum + 1; this.pageNum = this.pageNum + 1;
this.loadData('refresh'); this.loadData();
}, },
computed: { computed: {
...mapState(['hasLogin', 'userInfo']) ...mapState(['hasLogin', 'userInfo'])
@ -159,6 +192,15 @@ export default {
}, },
// //
async loadData(type = 'add', loading) { async loadData(type = 'add', loading) {
//
if (type === 'add') {
if (this.loadingType === 'nomore') {
return;
}
this.loadingType = 'loading';
} else {
this.loadingType = 'more';
}
//tab //tab
let index = this.tabCurrentIndex; let index = this.tabCurrentIndex;
let navItem = this.navList[index]; let navItem = this.navList[index];
@ -166,12 +208,16 @@ export default {
let status = navItem.status; let status = navItem.status;
let url; let url;
let params = { pageNum: this.pageNum, status: status }; let params = {
pageNum: this.pageNum,
status: status
};
console.log("params:------" + JSON.stringify(params))
let data = await Api.apiCall('get', Api.order.orderList, params); let data = await Api.apiCall('get', Api.order.orderList, params);
console.log("data:------" + data) console.log("data:------" + data)
let goodsList = data.records; let goodsList = data.records;
let goodsListJson = JSON.stringify(goodsList) let goodsListJson = JSON.stringify(goodsList)
console.log("goodsList:"+goodsListJson) // console.log("goodsList:" + goodsListJson)
let orderList = goodsList.filter(item => { let orderList = goodsList.filter(item => {
// //
item = Object.assign(item, this.orderStateExp(item.status)); item = Object.assign(item, this.orderStateExp(item.status));
@ -185,13 +231,15 @@ export default {
}); });
if (type === 'refresh') { if (type === 'refresh') {
this.orderList = []; navItem.orderList = [];
} }
this.orderList = this.orderList.concat(orderList); navItem.orderList = navItem.orderList.concat(orderList);
console.log("this.orderList.length======:"+this.orderList.length)
console.log("data.total======:" + data.total) console.log("data.total======:" + data.total)
console.log("length======:" + navItem.orderList.length)
//more nomore(20) //more nomore(20)
this.loadingType = this.orderList.length >= data.total ? 'nomore' : 'loading'; this.loadingType = navItem.orderList.length >= data.total ? 'nomore' : 'more';
console.log("type======:" + type)
console.log("loadingType======:" + this.loadingType)
if (type === 'refresh') { if (type === 'refresh') {
if (loading == 1) { if (loading == 1) {
uni.hideLoading(); uni.hideLoading();
@ -200,12 +248,6 @@ export default {
} }
} }
navItem.orderList = [];
console.log(orderList)
orderList.forEach(item => {
console.log("item-----:"+item)
navItem.orderList.push(item);
});
}, },
//swiper //swiper
@ -239,19 +281,23 @@ export default {
}, },
// //
async cancelOrder(item) { async cancelOrder(item) {
let params = { orderId: item.id }; let params = {
orderId: item.id
};
let data = await Api.apiCall('post', Api.order.closeOrder, params); let data = await Api.apiCall('post', Api.order.closeOrder, params);
console.log(data) console.log(data)
if (data) { if (data) {
this.$api.msg(data); this.$api.msg(data);
this.pageNum = 1; this.pageNum = 1;
this.loadData('refresh'); this.loadData('refresh');
this.tabCurrentIndex = 4; this.tabCurrentIndex = 1;
} }
}, },
// //
async confimDelivery(item) { async confimDelivery(item) {
let params = { id: item.id }; let params = {
id: item.id
};
let data = await Api.apiCall('post', Api.order.confimDelivery, params); let data = await Api.apiCall('post', Api.order.confimDelivery, params);
console.log(data); console.log(data);
if (data) { if (data) {
@ -272,7 +318,9 @@ export default {
//退 //退
async applyRefund1(item) { async applyRefund1(item) {
let params = { id: item.id }; let params = {
id: item.id
};
let data = await Api.apiCall('post', Api.order.applyRefund, params); let data = await Api.apiCall('post', Api.order.applyRefund, params);
if (data) { if (data) {
console.log(data); console.log(data);
@ -291,15 +339,10 @@ export default {
orderStateExp(value) { orderStateExp(value) {
let stateTip = '', let stateTip = '',
stateTipColor = '#fa436a'; stateTipColor = '#fa436a';
if (value === 12) {
stateTipColor = '#909399';
stateTip = '待付款';
}
if (value === 1) { if (value === 1) {
stateTipColor = '#909399'; stateTipColor = '#909399';
stateTip = '支付成功,没有回掉'; stateTip = '支付成功,没有回掉';
} } else if (value === 2) {
if (value === 2) {
stateTip = '待发货'; stateTip = '待发货';
} else if (value === 3) { } else if (value === 3) {
stateTip = '待收货'; stateTip = '待收货';
@ -314,6 +357,9 @@ export default {
stateTip = ' 维权已完成'; stateTip = ' 维权已完成';
} else if (value === 8) { } else if (value === 8) {
stateTip = '待分享'; stateTip = '待分享';
} else if (value === 12) {
stateTipColor = '#909399';
stateTip = '待付款';
} else if (value === 13) { } else if (value === 13) {
stateTip = '申请退款'; stateTip = '申请退款';
} else if (value === 14) { } else if (value === 14) {
@ -322,13 +368,14 @@ export default {
stateTip = '已关闭'; stateTip = '已关闭';
} else if (value === 16) { } else if (value === 16) {
stateTip = '无效订单'; stateTip = '无效订单';
} else if (value === 18) {
stateTip = '拼团下单';
} else { } else {
stateTip = '待付款'; stateTip = '待付款';
} }
return { stateTip, stateTipColor }; return {
stateTip,
stateTipColor
};
}, },
dateFormat(time) { dateFormat(time) {
@ -352,6 +399,7 @@ page,
.swiper-box { .swiper-box {
height: calc(100% - 40px); height: calc(100% - 40px);
} }
.list-scroll-content { .list-scroll-content {
height: 100%; height: 100%;
} }
@ -364,6 +412,7 @@ page,
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
position: relative; position: relative;
z-index: 10; z-index: 10;
.nav-item { .nav-item {
flex: 1; flex: 1;
display: flex; display: flex;
@ -373,8 +422,10 @@ page,
font-size: 15px; font-size: 15px;
color: $font-color-dark; color: $font-color-dark;
position: relative; position: relative;
&.current { &.current {
color: $base-color; color: $base-color;
&:after { &:after {
content: ''; content: '';
position: absolute; position: absolute;
@ -392,12 +443,14 @@ page,
.uni-swiper-item { .uni-swiper-item {
height: auto; height: auto;
} }
.order-item { .order-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-left: 30upx; padding-left: 30upx;
background: #fff; background: #fff;
margin-top: 16upx; margin-top: 16upx;
.i-top { .i-top {
display: flex; display: flex;
align-items: center; align-items: center;
@ -406,17 +459,21 @@ page,
font-size: $font-base; font-size: $font-base;
color: $font-color-dark; color: $font-color-dark;
position: relative; position: relative;
.time { .time {
flex: 1; flex: 1;
} }
.state { .state {
color: $base-color; color: $base-color;
} }
.del-btn { .del-btn {
padding: 10upx 0 10upx 36upx; padding: 10upx 0 10upx 36upx;
font-size: $font-lg; font-size: $font-lg;
color: $font-color-light; color: $font-color-light;
position: relative; position: relative;
&:after { &:after {
content: ''; content: '';
width: 0; width: 0;
@ -429,51 +486,67 @@ page,
} }
} }
} }
/* 多条商品 */ /* 多条商品 */
.goods-box { .goods-box {
height: 160upx; height: 160upx;
padding: 20upx 0; padding: 20upx 0;
white-space: nowrap; white-space: nowrap;
.goods-item { .goods-item {
width: 120upx; width: 120upx;
height: 120upx; height: 120upx;
display: inline-block; display: inline-block;
margin-right: 24upx; margin-right: 24upx;
} }
.goods-img { .goods-img {
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
/* 单条商品 */ /* 单条商品 */
.goods-box-single { .goods-box-single {
display: flex; display: flex;
padding: 20upx 0; padding: 20upx 0;
.goods-img { .goods-img {
display: block; display: block;
width: 120upx; width: 120upx;
height: 120upx; height: 120upx;
} }
.right { .right {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 0 30upx 0 24upx; padding: 0 30upx 0 24upx;
overflow: hidden; overflow: hidden;
.title { .title {
font-size: $font-base + 2upx; font-size: $font-base + 2upx;
color: $font-color-dark; color: $font-color-dark;
line-height: 1;
} }
.num_price {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 5px;
.attr-box { .attr-box {
flex: 1;
font-size: $font-sm + 2upx; font-size: $font-sm + 2upx;
color: $font-color-light; color: $font-color-light;
padding: 10upx 12upx; margin: 0 2upx 0 8upx;
} }
.price { .price {
font-size: $font-base + 2upx; font-size: $font-base + 2upx;
color: $font-color-dark; color: $font-color-dark;
&:before { &:before {
content: '¥'; content: '¥';
font-size: $font-sm; font-size: $font-sm;
@ -481,22 +554,28 @@ page,
} }
} }
} }
}
} }
.price-box { .price-box {
flex: 1;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: baseline; align-items: baseline;
padding: 20upx 30upx;
font-size: $font-sm + 2upx; font-size: $font-sm + 2upx;
color: $font-color-light; color: $font-color-light;
.num { .num {
margin: 0 8upx; margin: 0 8upx;
color: $font-color-dark; color: $font-color-dark;
} }
.price { .price {
font-size: $font-lg; font-size: $font-lg;
color: $font-color-dark; color: $font-color-dark;
&:before { &:before {
content: '¥'; content: '¥';
font-size: $font-sm; font-size: $font-sm;
@ -504,6 +583,7 @@ page,
} }
} }
} }
.action-box { .action-box {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
@ -512,6 +592,7 @@ page,
position: relative; position: relative;
padding-right: 30upx; padding-right: 30upx;
} }
.action-btn { .action-btn {
width: 160upx; width: 160upx;
height: 60upx; height: 60upx;
@ -524,12 +605,15 @@ page,
color: $font-color-dark; color: $font-color-dark;
background: #fff; background: #fff;
border-radius: 100px; border-radius: 100px;
&:after { &:after {
border-radius: 100px; border-radius: 100px;
} }
&.recom { &.recom {
background: #fff9f9; background: #fff9f9;
color: $base-color; color: $base-color;
&:after { &:after {
border-color: #f7bcc8; border-color: #f7bcc8;
} }

74
mallplusui-uniapp-app/pages/order/orderDetail.vue

@ -5,16 +5,15 @@
<scroll-view class="list-scroll-content" scroll-y> <scroll-view class="list-scroll-content" scroll-y>
<!-- 订单列表 --> <!-- 订单列表 -->
<view class="order-item"> <view class="order-item">
<view class="i-top b-b">
<text class="state" :style="{ color: orderInfo.stateTipColor }">{{orderInfo.orderSn}}</text>
</view>
<view class="i-top b-b"> <view class="i-top b-b">
<text class="time">{{ orderInfo.createTime }}</text> <text class="time">{{ orderInfo.createTime }}</text>
<!-- <text class="state" :style="{ color: orderInfo.stateTipColor }" @click="navToDetailPage(item)">{{ orderInfo.id }}--</text> --> <!-- <text class="state" :style="{ color: orderInfo.stateTipColor }" @click="navToDetailPage(item)">{{ orderInfo.id }}--</text> -->
<text class="state" <text class="state"
:style="{ color: orderInfo.stateTipColor }">{{ orderInfo.stateTip }}</text> :style="{ color: orderInfo.stateTipColor }">{{ orderInfo.stateTip }}</text>
<text v-if="orderInfo.status === 9" class="del-btn yticon icon-iconfontshanchu1"
@click="deleteOrder(index)"></text>
</view>
<view class="i-top b-b">
<text class="state" :style="{ color: orderInfo.stateTipColor }">订单商品</text>
</view> </view>
<view v-if="goodsItem.type === 1" class="goods-box-single" <view v-if="goodsItem.type === 1" class="goods-box-single"
@ -22,12 +21,20 @@
<img class="goods-img" :src="goodsItem.productPic" mode="aspectFill"></img> <img class="goods-img" :src="goodsItem.productPic" mode="aspectFill"></img>
<view class="right"> <view class="right">
<text class="title clamp">{{ goodsItem.productName }}</text> <text class="title clamp">{{ goodsItem.productName }}</text>
<text class="attr-box">{{ goodsItem.productAttr }} x <view class="num_price">
{{ goodsItem.productQuantity }}</text> <text class="attr-box">x {{ goodsItem.productQuantity }}</text>
<text class="price">{{ goodsItem.productPrice }}</text> <text class="price">{{ goodsItem.productPrice }}</text>
</view> </view>
<view style="display: flex;flex-direction: row;">
<text style="color: #c1c1c1;font-size: 13px;"
v-if="orderInfo.status === 5||orderInfo.status === 3">{{orderInfo.deliveryCompany}}</text>
<text style="color: #c1c1c1;font-size: 13px;"
v-if="orderInfo.status === 5||orderInfo.status === 3">{{ orderInfo.deliverySn }}</text>
</view> </view>
<view class="i-top b-b">
</view>
</view>
<!-- <view class="i-top b-b">
<text class="state" :style="{ color: orderInfo.stateTipColor }">订单赠品</text> <text class="state" :style="{ color: orderInfo.stateTipColor }">订单赠品</text>
</view> </view>
<view v-if="goodsItem.type === 2" class="goods-box-single" <view v-if="goodsItem.type === 2" class="goods-box-single"
@ -39,13 +46,15 @@
{{ goodsItem.productQuantity }}</text> {{ goodsItem.productQuantity }}</text>
<text class="price">{{ goodsItem.productPrice }} </text> <text class="price">{{ goodsItem.productPrice }} </text>
</view> </view>
</view> </view> -->
<view style="display: flex;flex-direction: column; margin-right: 13px;margin-bottom: 10px;">
<view class="price-box"> <view class="price-box">
<text class="num">{{ orderInfo.orderItemList.length }}</text> <text class="num">{{ orderInfo.orderItemList.length }}</text>
件商品, 会员折扣 件商品, 会员折扣
<text class="price">{{ orderInfo.vipAmount }}</text> <text class="price">{{ orderInfo.vipAmount }}</text>
优惠券抵扣 , 优惠券抵扣
<text class="price">{{ orderInfo.couponAmount }}</text> <text class="price">{{ orderInfo.couponAmount }}</text>
</view> </view>
<view class="price-box"> <view class="price-box">
@ -53,24 +62,25 @@
<text class="price">{{ orderInfo.integrationAmount }}</text> <text class="price">{{ orderInfo.integrationAmount }}</text>
, 运费 , 运费
<text class="price">{{ orderInfo.freightAmount }}</text> <text class="price">{{ orderInfo.freightAmount }}</text>
<view class="yt-list-cell b-b" v-if="groupActivity"> <!-- <view class="yt-list-cell b-b" v-if="groupActivity">
<text class="cell-tit clamp">活动金额</text> <text class="cell-tit clamp">活动金额</text>
<text class="cell-tip">{{ groupActivity.price }}</text> <text class="cell-tip">{{ groupActivity.price }}</text>
</view> </view> -->
, 实付款 , 实付款
<text class="price">{{ orderInfo.payAmount }}</text> <text class="price">{{ orderInfo.payAmount }}</text>
</view> </view>
<view class="action-box b-t"> </view>
<view class="action-box b-t" v-if="orderInfo.status==12||orderInfo.status==3">
<button v-if="orderInfo.status == 12" class="action-btn" <button v-if="orderInfo.status == 12" class="action-btn"
@click="cancelOrder(orderInfo)">取消订单</button> @click="cancelOrder(orderInfo)">取消订单</button>
<button v-if="orderInfo.status == 12" class="action-btn recom" <button v-if="orderInfo.status == 12" class="action-btn recom"
@click="payOrder(orderInfo)">立即支付</button> @click="payOrder(orderInfo)">立即支付</button>
<button v-if="orderInfo.status <7" class="action-btn recom" <!-- <button v-if="orderInfo.status <7" class="action-btn recom"
@click="applyRefund(orderInfo.id)">申请售后</button> @click="applyRefund(orderInfo.id)">申请售后</button> -->
<button v-if="orderInfo.status == 3" class="action-btn recom" <button v-if="orderInfo.status == 3" class="action-btn recom"
@click="confimDelivery(orderInfo)">确认收货</button> @click="confimDelivery(orderInfo)">确认收货</button>
<button class='action-btn recom' hover-class="btn-hover" v-if="orderInfo.status === 4" <!-- <button class='action-btn recom' hover-class="btn-hover" v-if="orderInfo.status === 4"
@click="toEvaluate(orderInfo.id)">立即评价</button> @click="toEvaluate(orderInfo.id)">立即评价</button>-->
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -101,7 +111,9 @@
data() { data() {
return { return {
tabCurrentIndex: 0, tabCurrentIndex: 0,
orderInfo: [], orderInfo: {
orderItemList:[]
},
navList: [{ navList: [{
status: 0, status: 0,
text: '全部', text: '全部',
@ -143,6 +155,8 @@
this.orderInfo = await Api.apiCall('get', Api.order.orderDetail, params); this.orderInfo = await Api.apiCall('get', Api.order.orderDetail, params);
this.orderInfo = Object.assign(this.orderInfo, this.orderStateExp(this.orderInfo.status)); this.orderInfo = Object.assign(this.orderInfo, this.orderStateExp(this.orderInfo.status));
this.orderInfo.createTime = this.dateFormat(this.orderInfo.createTime); this.orderInfo.createTime = this.dateFormat(this.orderInfo.createTime);
console.log("data:------" + JSON.stringify(this.orderInfo))
console.log("data:------" + this.orderInfo.stateTip)
}, },
methods: { methods: {
@ -233,15 +247,11 @@
orderStateExp(value) { orderStateExp(value) {
let stateTip = '', let stateTip = '',
stateTipColor = '#fa436a'; stateTipColor = '#fa436a';
if (value === 12) {
stateTipColor = '#909399';
return '待付款';
}
if (value === 1) { if (value === 1) {
stateTipColor = '#909399'; stateTipColor = '#909399';
return '支付成功,没有回掉'; stateTip= '支付成功,没有回掉';
} }else if (value === 2) {
if (value === 2) {
stateTip = '待发货'; stateTip = '待发货';
} else if (value === 3) { } else if (value === 3) {
stateTip = '待收货'; stateTip = '待收货';
@ -256,6 +266,9 @@
stateTip = ' 维权已完成'; stateTip = ' 维权已完成';
} else if (value === 8) { } else if (value === 8) {
stateTip = '待分享'; stateTip = '待分享';
}else if (value === 12) {
stateTipColor = '#909399';
stateTip= '待付款';
} else if (value === 13) { } else if (value === 13) {
stateTip = '申请退款'; stateTip = '申请退款';
} else if (value === 14) { } else if (value === 14) {
@ -426,10 +439,17 @@
line-height: 1; line-height: 1;
} }
.num_price {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 5px;
.attr-box { .attr-box {
flex: 1;
font-size: $font-sm + 2upx; font-size: $font-sm + 2upx;
color: $font-color-light; color: $font-color-light;
padding: 10upx 12upx; margin: 0 2upx 0 8upx;
} }
.price { .price {
@ -444,12 +464,12 @@
} }
} }
} }
}
.price-box { .price-box {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: baseline; align-items: baseline;
padding: 20upx 30upx;
font-size: $font-sm + 2upx; font-size: $font-sm + 2upx;
color: $font-color-light; color: $font-color-light;

Loading…
Cancel
Save