XSLu08042 20 timmar sedan
förälder
incheckning
96d20e321e

+ 0 - 42
api/integral.js

@@ -1,42 +0,0 @@
-import Request from '../common/request.js';
-let request = new Request().http
- 
- export function getIntegralGoodsList(data) {
- 	 return request('/app/integral/getIntegralGoodsList',data,'GET');
- }
- export function getIntegralGoodsById(data) {
- 	 return request('/app/integral/getIntegralGoodsById',data,'GET');
- }
- export function getUserIntegralLogsList(data) {
- 	 return request('/app/integral/getUserIntegralLogsList',data,'GET');
- }
- export function getIntegralOrderList(data) {
- 	 return request('/app/integral/getIntegralOrderList',data,'GET');
- }
- export function getIntegralOrderById(data) {
- 	 return request('/app/integral/getIntegralOrderById',data,'GET');
- }
- 
- export function createOrder(data) {
-  	return request('/app/integral/createOrder',data,'POST','application/json;charset=UTF-8');
- }
- 
- export function getUserSign() {
- 	 return request('/app/integral/getUserSign',null,'GET');
- }
- 
- export function doSign(data) {
- 	 return request('/app/integral/sign',data,'POST','application/json;charset=UTF-8');
- }
- 
- 
-  
-  
- 
- 
- 
- 
- 
-  
-  
-  

+ 2 - 2
common/request.js

@@ -5,8 +5,8 @@ export default class Request {
 		// let path = 'http://127.0.0.1:8113';
 		// var path=uni.getStorageSync('requestPath')
 
-		var path = 'https://storeuserapp.bjyjbao.com'; //正式
-		// var path = "http://b5a69d43.natappfree.cc"
+		// var path = 'https://storeuserapp.bjyjbao.com'; //正式
+		var path = "http://q262c6a3.natappfree.cc"
 		// var path = "http://192.168.10.196:8113"
 		let token="";
 		let type = 0

+ 3 - 1
main.js

@@ -1,7 +1,7 @@
 import App from './App'
 import store from './store'
 import uView from "@/node_modules/uview-ui";
-import {formatSalesNum} from "@/utils/tools.js"
+import {formatSalesNum,formatNum} from "@/utils/tools.js"
 import {getDict,isEmpty,parseIDCardInfo,parseText,urlToObj,clearHisSearch,getHisSearch,addHisSearch,logout,getDictLabelName,getProvider,parsePhone,isLogin,getAge,parseIdCard,isLoginCourse,reLoginCheck} from './utils/common.js'
 // #ifndef VUE3
 import Vue from 'vue'
@@ -12,6 +12,7 @@ App.mpType = 'app'
 
 Vue.use(Vuex)
 Vue.use(uView);
+Vue.prototype.$formatNum= formatNum;
 Vue.prototype.$formatSalesNum= formatSalesNum;
 Vue.prototype.$getProvider = getProvider;
 Vue.prototype.$parsePhone = parsePhone;
@@ -67,6 +68,7 @@ export function createApp() {
   app.config.globalProperties.$isLoginCourse = isLoginCourse
   app.config.globalProperties.$formatSalesNum = formatSalesNum
   app.config.globalProperties.$getDict = getDict
+  app.config.globalProperties.$formatNum = formatNum
   
   app.use(uviewPlus)
   return {

+ 97 - 43
pages.json

@@ -1140,7 +1140,8 @@
 				    {
 				        "navigationBarTitleText": "积分商城",
 						"navigationBarTextStyle": "black",
-						"navigationBarBackgroundColor": "#ffffff"
+						"navigationBarBackgroundColor": "#ffffff",
+						"navigationStyle": "custom"
 				    }
 				    
 				}
@@ -1155,52 +1156,61 @@
 				    
 				}
 				,{
-				    "path" : "integralOrderList",
-				    "style" :                                                                                    
-				    {
-				        "navigationBarTitleText": "兑换订单",
+					"path": "integralOrderDelivery",
+					"style": {
+						"navigationBarTitleText": "物流查询",
 						"navigationBarTextStyle": "black",
 						"navigationBarBackgroundColor": "#ffffff"
-				    }
-				    
-				}
-				,{
-				    "path" : "integralOrderDetails",
-				    "style" :                                                                                    
-				    {
-				        "navigationBarTitleText": "订单详情"
-				    }
-				    
-				}
-				,{
-				    "path" : "integralLogsList",
-				    "style" :                                                                                    
-				    {
-				        "navigationBarTitleText": "积分记录",
+					}
+				
+				}, {
+					"path": "integralOrderList",
+					"style": {
+						"navigationBarTitleText": "兑换订单",
 						"navigationBarTextStyle": "black",
 						"navigationBarBackgroundColor": "#ffffff"
-				    }
-				    
-				}
-				,{
-				    "path" : "integralOrderPay",
+					}
+				
+				}, {
+					"path": "integralOrderDetails",
+					"style": {
+						"navigationBarTitleText": "订单详情"
+					}
+				
+				}, {
+					"path": "integralLogsList",
+					"style": {
+						"navigationBarTitleText": "获得记录",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+					}
+				
+				}, {
+					"path": "integralOrderPay",
+					"style": {
+						"navigationBarTitleText": "积分兑换",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+					}
+				
+				},{
+				    "path" : "integralPayment",
 				    "style" :                                                                                    
 				    {
-				        "navigationBarTitleText": "积分兑换",
+				        "navigationBarTitleText": "支付订单",
 						"navigationBarTextStyle": "black",
 						"navigationBarBackgroundColor": "#ffffff"
 				    }
 				    
 				}
 				,{
-				    "path" : "integralOrderPaySuccess",
-				    "style" :                                                                                    
-				    {
-				        "navigationBarTitleText": "兑换结果",
+					"path": "integralOrderPaySuccess",
+					"style": {
+						"navigationBarTitleText": "兑换结果",
 						"navigationBarTextStyle": "black",
 						"navigationBarBackgroundColor": "#ffffff"
-				    }
-				    
+					}
+				
 				}
 				,{
 				    "path" : "integral",
@@ -1470,7 +1480,60 @@
 						"navigationBarTextStyle":"black"
 				 	}
 				 	
-				 }
+				 },{
+					"path": "cart",
+					"style": {
+						"navigationBarTitleText": "购物车",
+						"enablePullDownRefresh": false,
+						"navigationBarBackgroundColor":"#ffffff",
+						"navigationBarTextStyle":"black"
+					}
+				},{
+					"path": "confirmIntegralOrder",
+					"style": {
+						"navigationBarTitleText": "积分兑换",
+						"enablePullDownRefresh": false,
+						"navigationBarBackgroundColor":"#ffffff",
+						"navigationBarTextStyle":"black"
+					}
+				}
+				,{
+					"path": "integral/refundOrder",
+					"style": {
+						"navigationBarTitleText": "售后订单",
+						"enablePullDownRefresh": false,
+						"navigationBarBackgroundColor":"#ffffff",
+						"navigationBarTextStyle":"black"
+					}
+				}
+				,{
+					"path": "integral/refundOrderList",
+					"style": {
+						"navigationBarTitleText": "售后订单",
+						"enablePullDownRefresh": false,
+						"navigationBarBackgroundColor":"#ffffff",
+						"navigationBarTextStyle":"black"
+					}
+				}
+				,{
+					"path": "integral/refundOrderDetail",
+					"style": {
+						"navigationBarTitleText": "售后详情",
+						"enablePullDownRefresh": false,
+						"navigationStyle": "custom",
+						"navigationBarBackgroundColor":"#ffffff",
+						"navigationBarTextStyle":"black"
+					}
+				}
+				,{
+					"path": "integral/refundOrderDelivery",
+					"style": {
+						"navigationBarTitleText": "物流信息",
+						"enablePullDownRefresh": false,
+						"navigationBarBackgroundColor":"#ffffff",
+						"navigationBarTextStyle":"black"
+					}
+				}
 			]
 		},
 		{
@@ -2029,15 +2092,6 @@
 					"navigationStyle": "custom",
 					"navigationBarTextStyle": "black"
 				  }
-				},
-				{
-				  "path": "pages/common/detailsFileds/index",
-				  "style": {
-				    "navigationBarTitleText": "个人资料明细",
-				    "enablePullDownRefresh": false,
-					"navigationStyle": "custom",
-					"navigationBarTextStyle": "black"
-				  }
 				}
 			]
 		}

+ 63 - 34
pages/index/index.vue

@@ -54,10 +54,27 @@
 						<view>商家入驻</view>
 					</view>
 				</view>
+				<!-- 推荐分类 -->
+				<recommendCategory :list="tuiCates" v-if="tuiCates.length>0" title="推荐分类"></recommendCategory>
+				<!-- 秒杀与积分商城 -->
+				<view class="promotion-box">
+					<view class="promotion-item" @click="navTo('dev')">
+						<view class="info">
+							<view class="title">秒杀商品</view>
+							<view class="sub-title">惊喜秒杀 限时礼遇</view>
+						</view>
+						<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/fs/20260719/ab71efacefe1469095ce46fc7d317c08.png" mode="widthFix"></image>
+					</view>
+					<view class="promotion-item" @click="navTo('/pages_user/integralGoodsList')">
+						<view class="info">
+							<view class="title">积分商城</view>
+							<view class="sub-title">积分兑换 好礼上新</view>
+						</view>
+						<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/fs/20260719/3f5909fbfe0e4b4caa503ef2632f511c.png" mode="widthFix"></image>
+					</view>
+				</view>
 				<view class="modules">
 					<view class="module" v-for="(it,index) in layouts" :key="index">
-						<!-- 推荐分类 -->
-						<recommendCategory :list="tuiCates" v-if="it.id==10&&it.isShow&&tuiCates.length>0" title="推荐分类"></recommendCategory>
 						<!-- 推荐药品 -->
 						<tuiProduct ref="tuiProduct" v-if="it.id==8&&it.isShow"></tuiProduct>
 						<!-- 特色药店 -->
@@ -419,30 +436,6 @@
 			},
 		},
 		methods: {
-			loginNavTo(url){
-				this.$isLogin().then(
-					res => {
-						console.log(res)
-						if(res){
-							uni.navigateTo({
-								url: url
-							})
-						}
-						else{
-							uni.navigateTo({
-								url:'/pages/auth/login'
-							})
-						}
-					}
-				);
-				 
-			},
-			dev(){
-				uni.showToast({
-					icon:"none",
-					title: '敬请期待'
-				})
-			},
 			getStore() {
 				validList().then(res=>{
 					if(res.code==200) {
@@ -764,21 +757,57 @@
 					});
 					return;
 				}
-				console.log(url)
 				uni.navigateTo({
 					url: url
 				})
-			},
-			 navToTest() {
-				 const course = {"companyId":100,"companyUserId":6806,"corpId":"ww5a88c4f879f204c5","courseId":63,"link":"1899022782092541952","linkType":3,"qwExternalId":9914983,"qwUserId":"18931","videoId":409}
-				 uni.navigateTo({
-				 	url: '/pages_course/video?course='+JSON.stringify(course)
-				 })
-			 }
+			}
 		}
 	}
 </script>
 <style scoped lang="scss">
+	.promotion-box {
+		margin: 0 24rpx 24rpx;
+		display: flex;
+		justify-content: space-between;
+		.promotion-item {
+			width: 342rpx;
+			height: 136rpx;
+			background: #FFFFFF;
+			border-radius: 16rpx;
+			padding: 24rpx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			box-sizing: border-box;
+			position: relative;
+			overflow: hidden;
+			.info {
+				position: relative;
+				z-index: 2;
+				.title {
+					// font-family: PingFang SC;
+					font-weight: bold;
+					font-size: 34rpx;
+					color: #222222;
+				}
+				.sub-title {
+					margin-top: 8rpx;
+					font-family: PingFang SC;
+					font-weight: 400;
+					font-size: 24rpx;
+					color: #757575;
+				}
+			}
+			image {
+				width: 130rpx;
+				height: 128rpx;
+				position: absolute;
+				right: 0;
+				bottom: 4rpx;
+				z-index: 1;
+			}
+		}
+	}
 	.img-item{
 		position: relative;
 		width: 44rpx;

+ 4 - 0
pages/user/index.vue

@@ -133,6 +133,10 @@
 							<image class="min-image" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/image/userimg/coupon_collection_center.png"></image>
 							<view class="title">领券中心</view>
 						</view>
+						<view class="menu"  @click="navTo('/pages_user/integralGoodsList')">
+							<image class="min-image" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/fs/20260721/6a74196fca8244ce847294afd38866bd.png"></image>
+							<view class="title">积分商城</view>
+						</view>
 						<!-- <view class="menu"  @click="loginNavTo('/pages_order/invoice/invoiceList')">
 							<image class="min-image" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/34eb8ee3f7b3471fb919c76e4d0735cf.png"></image>
 							<view class="title">开票历史</view>

+ 63 - 0
pages_user/api/integral.js

@@ -0,0 +1,63 @@
+import Request from '@/common/request.js';
+let request = new Request().http
+ 
+ export function getIntegralGoodsList(data) {
+ 	 return request('/app/integral/getIntegralGoodsList',data,'GET');
+ }
+ export function getIntegralGoodsById(data) {
+ 	 return request('/app/integral/getIntegralGoodsById',data,'GET');
+ }
+ export function getUserIntegralLogsList(data) {
+ 	 return request('/app/integral/getUserIntegralLogsList',data,'GET');
+ }
+ export function getIntegralOrderList(data) {
+ 	 return request('/app/integral/getIntegralOrderList',data,'GET');
+ }
+ export function getIntegralOrderById(data) {
+ 	 return request('/app/integral/getIntegralOrderById',data,'GET');
+ }
+ 
+ export function createOrder(data) {
+  	return request('/app/integral/createOrder',data,'POST','application/json;charset=UTF-8');
+ }
+ 
+ export function getUserSign() {
+ 	 return request('/app/integral/getUserSign',null,'GET');
+ }
+ 
+ export function doSign(data) {
+ 	 return request('/app/integral/sign',data,'POST','application/json;charset=UTF-8');
+ }
+export function payment(data) {
+  	return request('/app/integral/payment',data,'POST','application/json;charset=UTF-8');
+ }
+ export function cannelOrder(data) {
+  	return request('/app/integral/cannelOrder',data,'POST','application/json;charset=UTF-8');
+ }
+ 
+ export function getCartCount() {
+  	return request('/app/integral/getCartCount',null,'GET');
+ }
+ export function addOrUpdateCart(data) {
+  	return request('/app/integral/addOrUpdateCart',data,'POST','application/json;charset=UTF-8');
+ }
+ export function getCarts() {
+  	return request('/app/integral/getCarts',null,'GET');
+ }
+ export function delCart(data) {
+  	return request('/app/integral/delCart',data,'POST','application/json;charset=UTF-8');
+ }
+ export function createCartOrder(data) {
+  	return request('/app/integral/createCartOrder',data,'POST','application/json;charset=UTF-8');
+ }
+ export function getCartByIds(data) {
+  	return request('/app/integral/getCartByIds',data,'POST','application/json;charset=UTF-8');
+ }
+ 
+ export function getExpress(data) {
+ 	 return request('/app/integral/getExpress',data,'POST','application/json;charset=UTF-8');
+ }
+ 
+ export function compute(data) {
+  	return request('/app/integral/compute',data,'POST','application/json;charset=UTF-8');
+ }

+ 27 - 0
pages_user/api/integralAfterSales.js

@@ -0,0 +1,27 @@
+import Request from '@/common/request.js';
+let request = new Request().http
+ 
+ export function getMyStoreOrderItemByOrderId(data) {
+ 	 return request('/app/integral/getMyStoreOrderItemByOrderId',data,'GET');
+ } 
+ export function applyAfterSales(data) {
+ 	 return request('/app/integral/applyAfterSales',data,'POST','application/json;charset=UTF-8');
+ }
+ 
+ export function getAfterSalesList(data) {
+ 	 return request('/app/integralAfterSales/getAfterSalesList',data,'GET');
+ } 
+ 
+ export function getAfterSalesDetails(data) {
+ 	 return request('/app/integralAfterSales/getAfterSalesDetails',data,'GET');
+ } 
+ export function revoke(data) {
+ 	 return request('/app/integral/revokeAfterSales',data,'POST','application/json;charset=UTF-8');
+ }
+
+export function getErpReturnInfo() {
+	 return request('/app/inquiryOrder/getErpReturnInfo',null,'GET');
+}
+ 
+ 
+ 

+ 436 - 0
pages_user/cart.vue

@@ -0,0 +1,436 @@
+<template>
+	<view class="content">
+		<!-- 商品列表 -->
+		<view class="goods-list">
+			<view class="item" v-for="(item,index) in carts" :key="index">
+				<view class="choose" @click.stop="checkChange(item,index)">
+				<!-- 	<checkbox :value="shop.checked" :checked="shop.checked" @click="checkShopChange(shop)" style="transform: scale(0.9);" /> -->
+					<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/fs/20250729/1753758788583.png" v-show="item.checked"></image>
+					<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/fs/20250729/1753758821601.png" v-show="!item.checked"></image>
+				</view>
+				<image class="goods-img" :src="item.imgUrl" mode="aspectFit" @click="showProduct(item)"></image>
+				<view class="info-box" @click="showProduct(item)">
+					<view>
+						<view class="title-box">
+							<view class="title ellipsis">{{ item.goodsName }}</view>
+						</view>
+					</view>
+					<view class="price-num">
+						<view class="price">
+							<text class="text" >{{item.newIntegral}}</text>
+							<text class="unit">积分</text>
+							<text class="unit">+</text>
+							<text class="text" >{{$formatNum(item.newCash)}}</text>
+							<text class="unit">元</text>
+						</view>
+						<view class="num-box" @click.stop>
+							<u-number-box v-model="item.cartNum" buttonSize="48rpx" integer :step="1" :min="1" :max="100000" @change="changeCartNum($event,item)"></u-number-box>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	 
+		<view v-if="carts.length == 0" class="no-data-box">
+			<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdtappimgs/cf4a86b913a04341bb44e34bb4d37aa2.png" mode="aspectFit"></image>
+			<view class="empty-title">购物车为空</view>
+			<view class="empty-cart-btn x-f" @click="goPage">去逛逛</view>
+		</view>
+		<!-- 猜你喜欢 -->
+		 
+		<!-- <view class="like-product">
+			<likeProduct  ref="product" />
+		</view> -->
+		<!-- 底部按钮 -->
+		<view class="btn-foot">
+			<view class="left">
+				<view class="choose" @click="handleCheckAll()">
+					<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/fs/20250729/1753758788583.png" v-show="checkAll"></image>
+					<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/fs/20250729/1753758821601.png" v-show="!checkAll"></image>
+				</view>
+				<text class="text">全选</text>
+				<text class="text" @click="delCart()">删除</text>
+			</view>
+			<view class="right">
+				<view>
+					<view class="total">
+						<text class="label">合计:</text>
+						<view class="price">
+							<text class="unit">¥</text>
+							<text class="num">{{$formatNum(totalMoney)}}</text>
+						</view>
+					</view>
+					<view class="total">
+						<text class="label">所需积分:</text>
+						<view class="price">
+							<text class="num">{{totalIntegral}}</text>
+						</view>
+					</view>
+				</view>
+				<view class="btn" @click="submit">结算</view>
+			</view>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	import { getCarts,addOrUpdateCart,delCart } from './api/integral.js'
+	// import likeProduct from '@/components/likeProduct.vue'
+	export default {
+		// components: {
+		// 	likeProduct
+		// },	
+		data() {
+			return {
+				totalMoney:0.00,
+				totalIntegral: 0,
+				carts:[],
+				checkAll:false,
+			}	
+		},
+		onLoad() {
+			this.getCarts();
+ 
+		},
+		onReachBottom() {
+			// this.$refs.product.getGoodsProducts();
+		},
+		methods: {
+			delCart(){
+				var selectCarts=this.carts.filter(ele => ele.checked==true).map(ele => {
+				  return ele.id
+				});
+				if(selectCarts.length==0){
+					uni.showToast({
+						icon:'none',
+						title: "请选择商品删除",
+					});
+					return;
+				}
+				let data = {ids:selectCarts};
+				delCart(selectCarts).then(
+					res => {
+						if(res.code==200){
+							uni.showToast({
+								icon:'success',
+								title: "操作成功",
+							});
+							this.getCarts()
+						}else{
+							
+							uni.showToast({
+								icon:'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+			computedMoney(){
+				let totalIntegral = 0;
+				let totalMoney = 0;	
+				let arry = this.carts.filter(item=>item.checked)
+				arry.forEach(item => {
+				  totalIntegral += item.newIntegral * item.cartNum;
+				  totalMoney += item.newCash * item.cartNum;
+				});
+				this.totalIntegral = totalIntegral;
+				this.totalMoney = totalMoney;
+			},
+			handleCheckAll(){
+				this.checkAll=!this.checkAll;
+				var that=this;
+				this.carts.forEach((item,index,arr)=>{
+				     item.checked=that.checkAll;
+				})
+				this.computedMoney();
+			},
+			checkChange(item,index){
+				item.checked=!item.checked;
+				this.checkAll =  this.carts.length > 0 &&this.carts.every(item=>item.checked)
+				this.computedMoney();
+			},
+			changeNum(e,item) {
+				item.cartNum = e.detail.value.replace(/\D/g, '')
+				if (item.cartNum <= 1) {
+				  uni.showToast({
+				    title: "已经是底线啦!",
+				    icon: "none",
+				    duration: 2000
+				  });
+				  return;
+				}
+				if(item.cartNum < 1) {
+					item.cartNum = 1
+				}
+				if(item.cartNum>=item.stock){
+					item.cartNum=item.stock;
+				}
+				this.changeCartNum(item)
+			},
+			getCarts(){
+				getCarts().then(
+					res => {
+						if(res.code==200){
+							 this.carts=res.carts;
+							 this.carts.forEach((item,index,arr)=>{
+							      item.checked=false;
+							 })
+							 this.checkAll =  this.carts.length > 0 &&this.carts.every(item=>item.checked)
+							 this.computedMoney();
+						}else{
+							uni.showToast({
+								icon:'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+			changeCartNum(e,item){
+				let data = {cartNum:e.value,goodsId:item.goodsId,isCart: 1};
+				addOrUpdateCart(data).then(
+					res => {
+						if(res.code==200){
+							this.computedMoney();	
+						}else{
+							
+							uni.showToast({
+								icon:'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+			// 结算
+			submit() {
+				var selectCarts=this.carts.filter(ele => ele.checked==true).map(ele => {
+				  return ele.id
+				});
+				if(selectCarts.length==0){
+					uni.showToast({
+						icon:'none',
+						title: "请选择商品",
+					});
+					return;
+				}
+				uni.navigateTo({
+					url: '/pages_user/confirmIntegralOrder?type=cart&cartIds='+selectCarts.toString()
+				})
+			},
+			showProduct(item){
+				uni.navigateTo({
+					url: '/pages_user/integralGoodsDetails?goodsId='+item.goodsId
+				})
+			},
+			goPage() {
+				uni.navigateTo({
+					url: '/pages_user/integralGoodsList'
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		height: 100%;
+	}
+	.content{
+		height: 100%;
+		padding: 20upx;
+		.goods-list{
+			.item{
+				box-sizing: border-box;
+				background: #FFFFFF;
+				border-radius: 16upx;
+				margin-bottom: 20upx;
+				padding: 30upx;
+				display: flex;
+				align-items: center;
+				&:last-child{
+					margin-bottom: 0;
+				}
+				.goods-img{
+					width: 160upx;
+					height: 160upx;
+					background: #FFFFFF;
+					margin-right: 30upx;
+					flex-shrink: 0;
+				}
+				.info-box{
+					display: flex;
+					flex-direction: column;
+					justify-content: space-between;
+					width: calc(100% - 255upx);
+					.title-box{
+						width: 100%;
+						display: flex;
+						align-items: center;
+						.title{
+							flex: 1;
+							font-size: 28upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #111111;
+							line-height: 1;
+						}
+					}
+					.price-num{
+						margin-top: 24rpx;
+						.price{
+							margin-bottom: 24rpx;
+							display: flex;
+							align-items: flex-end;
+							.unit{
+								font-size: 24upx;
+								font-family: PingFang SC;
+								font-weight: 500;
+								color: #FF5030;
+								line-height: 1.2;
+								margin-right: 4upx;
+							}
+							.text{
+								font-size: 32upx;
+								font-family: PingFang SC;
+								font-weight: bold;
+								color: #FF5030;
+								line-height: 1;
+							}
+						}
+						.num-box{
+							display: flex;
+							align-items: center;
+							justify-content: flex-end;
+							.img-box{
+								width: 60upx;
+								height: 60upx;
+								// border-radius: 4upx;
+								border: 1px solid #dddddd;
+								display: flex;
+								align-items: center;
+								justify-content: center;
+								image{
+									width: 25rpx;
+									height: 25rpx;
+								}
+							}
+							input{
+								width: 60upx;
+								height: 60upx;
+								line-height: 60upx;
+								font-size: 28upx;
+								font-family: PingFang SC;
+								font-weight: 500;
+								color: #111111;
+								// border-radius: 4upx;
+								border-top: 1px solid #dddddd;
+								border-bottom: 1px solid #dddddd;
+								text-align: center;
+								// margin: 0 16upx;
+							}
+						}
+					}
+				}
+			}
+		}
+		.like-product{
+			padding-bottom: 120upx;
+		}
+		.btn-foot{
+			box-sizing: border-box;
+			width: 100%;
+			height: 121upx;
+			background: #FFFFFF;
+			padding: 16upx 30upx 16upx 30upx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			position: fixed;
+			left: 0;
+			bottom: 0;
+			z-index: 99;
+			.left{
+				display: flex;
+				align-items: center;
+				.text{
+					margin-left: 14upx;
+					font-size: 28upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #666666;
+					line-height: 1;
+				}
+			}
+			.right{
+				display: flex;
+				align-items: center;
+				.total{
+					display: flex;
+					align-items: flex-end;
+					margin-right: 36upx;
+					.label{
+						font-size: 26upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #999999;
+						line-height: 1.5;
+					}
+					.price{
+						display: flex;
+						align-items: flex-end;
+						.unit{
+							font-size: 24upx;
+							font-family: PingFang SC;
+							font-weight: bold;
+							color: #FF5030;
+							line-height: 1.2;
+							margin-right: 10upx;
+						}
+						.num{
+							font-size: 32rpx;
+							font-family: PingFang SC;
+							font-weight: bold;
+							color: #FF5030;
+							line-height: 1;
+						}
+					}
+				}
+				.btn{
+					width: 200upx;
+					height: 88upx;
+					line-height: 88upx;
+					text-align: center;
+					font-size: 30upx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #FFFFFF;
+					background: #2583EB;
+					border-radius: 44upx;
+				}
+			}
+		}
+	}
+	.choose {
+		margin-right: 20rpx;
+		image{
+			width: 36rpx;
+			height: 36rpx;
+			flex-shrink: 0;
+		}
+	}
+	.empty-cart-btn {
+		border: 1rpx solid #2583EB;
+		color: #2583EB;
+		padding: 10rpx 30rpx;
+		border-radius: 40rpx;
+		margin-bottom: 20vh;
+		margin-top: 50rpx;
+		display: inline-block;
+	}
+</style>

+ 728 - 0
pages_user/confirmIntegralOrder.vue

@@ -0,0 +1,728 @@
+<template>
+	<view>
+		<view class="inner-box">
+			<!-- 收货人 -->
+			<view class="address-box" v-if="address==null" @click="openAddress()">
+				<view class="left">
+					<view class="name-box">
+						<text class="text name">添加收货地址</text>
+					</view>
+				</view>
+				<view class="arrow-box">
+					<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/arrow_gray.png" mode=""></image>
+				</view>
+			</view>
+			<view class="address-box" v-if="address!=null" @click="openAddress()">
+				<view class="left">
+					<view class="name-box">
+						<text class="text name">{{address.realName}}</text>
+						<text class="text" v-if="address.phone!=null">{{address.phone}}</text>
+					</view>
+					<view class="address">
+						{{address.address}} 
+					</view>
+				</view>
+				<view class="arrow-box">
+					<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/arrow_gray.png" mode=""></image>
+				</view>
+			</view>
+			<!-- 药品列表 -->
+			<view class="goods-list">
+				<view class="item" v-for="(item,index) in goodsList" :key="index">
+					<view class="img-box">
+						<image :src="item.imgUrl==''?'https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/drug.svg':item.imgUrl" mode="aspectFill"></image>
+					</view>
+					<view class="info-box">
+						<view>
+							<view class="name-box ellipsis2">
+								{{item.goodsName}}
+							</view>
+							 
+						</view>
+						<view class="price-num">
+							<view class="price">
+								<text class="num">{{item.newIntegral}}</text>
+								<text class="unit">积分</text>
+								<text class="num" v-show="item.newCash>0">+{{$formatNum(item.newCash)}}</text>
+								<text class="unit" v-show="item.newCash>0">元</text>
+							</view>
+							<view class="num"  >x{{item.cartNum}}</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="other-info">
+				<!-- 商品积分,优惠积分,所需积分,应付金额,优惠金额,运费,支付金额, -->
+				<view class="item">
+					<view class="left">
+						<text class="label">商品总积分:</text>
+					</view>
+					<view class="right">
+						<text class="text">{{priceInfo.totalIntegral}}</text>
+					</view>
+				</view>
+				<view class="item" v-if="priceInfo.discountIntegral">
+					<view class="left">
+						<text class="label">优惠积分:</text>
+					</view>
+					<view class="right">
+						<text class="text">-{{priceInfo.discountIntegral}}</text>
+					</view>
+				</view>
+				<view class="item">
+					<view class="left">
+						<text class="label">支付积分:</text>
+					</view>
+					<view class="right">
+						<text class="text">{{priceInfo.integral}}</text>
+					</view>
+				</view>
+				<view class="item">
+					<view class="left">
+						<text class="label">总金额:</text>
+					</view>
+					<view class="right">
+						<text class="text">¥{{priceInfo.totalCash || '0'}}</text>
+					</view>
+				</view>
+				<view class="item" v-if="priceInfo.discountCash">
+					<view class="left">
+						<text class="label">优惠金额:</text>
+					</view>
+					<view class="right">
+						<text class="text">-¥{{priceInfo.discountCash || '0'}}</text>
+					</view>
+				</view>
+				<view class="item">
+					<view class="left">
+						<text class="label">运费:</text>
+					</view>
+					<view class="right">
+						<text class="text">¥{{priceInfo.deliveryMoney || '0'}}</text>
+					</view>
+				</view>
+				<view class="item" v-if='priceInfo.cash>0'>
+					<view class="left">
+						<text class="label">支付金额:</text>
+					</view>
+					<view class="right">
+						<text class="text">¥{{$formatNum(priceInfo.cash)}}</text>
+					</view>
+				</view>
+			</view>
+			<view class="pay-type" v-if='priceInfo.cash>0'>
+				<view class="title">支付方式</view>
+				<radio-group>
+					<view class="item">
+						<view class="left" >
+							<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/wecha_pay.png" mode=""></image>
+							<text class="text">全款支付</text>
+						</view>
+						<label>
+							<radio :value="1" :checked="payType=='1'" color="#2583EB" />
+						</label>
+					</view>
+				</radio-group>
+			</view>
+			<!-- 备注 -->
+			<!-- <view class="remarks" v-if='totalMoney>0&&order!=null'>
+				<input type="text" v-model="order.remark" placeholder="备注留言(选填)" placeholder-class="input" />
+			</view> -->
+		</view>
+		
+		<!-- 底部按钮 -->
+		<view class="btn-box" v-if="goodsList&&goodsList.length > 0">
+			<view class="btn" @click="payOrder()">{{priceInfo.cash>0?'立即支付':'立即兑换'}}</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {getCartByIds,createCartOrder,compute} from './api/integral.js'
+	import {getUserInfo} from '@/api/user'
+	export default {
+		data() {
+			return {
+				addressId:null,
+				address:null,
+				orderId:null,
+				order:null,
+				goodsList:[],
+				integral: 0,
+				totalIntegral: 0,
+				payTypes: [],
+				payType: '1',
+				alipayQrCode:null,
+				showPayTips:false,
+				cartIds: '',
+				totalMoney: 0,
+				priceInfo: {
+					totalIntegral:0,
+					integral:0,
+					discountIntegral:0,
+					totalCash:0,
+					cash:0,
+					discountCash:0,
+					deliveryMoney:0,
+				}
+			}
+		},
+		onLoad(option) {
+			this.cartIds=option.cartIds || '';
+			var that=this;
+			uni.$on('updateAddress', (e) => {
+				that.addressId=e.addressId;
+			 	that.address=e;
+				that.address.address=e.province+e.city+e.district+e.detail
+				that.compute()
+			})
+			this.getCartByIds();
+			this.getUserInfo();
+		},
+		onUnload() {
+			uni.$off('updateAddress')
+		},
+		methods: {
+			getUserInfo(){
+				getUserInfo().then(
+					res => {
+						if(res.code==200){
+							if(res.user!=null){
+								this.integral=res.user.integral;
+							}
+						}
+					},
+					rej => {}
+				);
+			},
+			getCartByIds(){
+				const ids = this.cartIds.split(',')
+				getCartByIds(ids).then(
+					res => {
+						if(res.code==200){
+							this.goodsList=res.data;
+							this.compute()
+						}else{
+							 
+						}
+					},
+					rej => {}
+				);
+			},
+			calcTotal(cartData,type) {
+			  let total = 0;
+			
+			  cartData.forEach(item => {
+			    total += item[type] * item.cartNum;
+			  });
+			
+			  return total;
+			},
+			openAddress(){
+				uni.navigateTo({
+					url: '/pages_user/address'
+				})
+			},
+			compute() {
+				const param = {
+					userCouponId: '',
+					userAddressId: this.addressId,
+					cartIds: this.cartIds.split(','),
+				}
+				compute(param).then(res=>{
+					if(res.code == 200) {
+						this.priceInfo = res.data
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: res.msg,
+						});
+					}
+				})
+			},
+			payOrder(){
+				if(this.addressId==null){
+					uni.showToast({
+						icon:'none',
+						title: "请选择收货地址",
+					});
+					return;
+					
+				}
+				var data = {
+					ids:this.cartIds.split(','),
+					addressId:this.addressId,
+				};
+				var that=this;
+				uni.showLoading();
+				createCartOrder(data).then(
+					res => {
+						if(res.code==200){
+							this.orderId = res.order.orderId
+							if(this.priceInfo.cash > 0) {
+								uni.redirectTo({
+									url:"./integralPayment?orderId="+res.order.orderId
+								}) 
+							} else {
+								uni.redirectTo({
+									url:"./integralOrderPaySuccess?orderId="+res.order.orderId
+								}) 
+							} 
+							
+						}else{
+							uni.showToast({
+								icon:'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
+				
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.inner-box{
+		padding: 20upx 20upx 160upx;
+		.address-box{
+			box-sizing: border-box;
+			min-height: 171upx;
+			background: #FFFFFF;
+			border-radius: 16upx;
+			background-image: url(https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/address_bg.png);
+			background-repeat: no-repeat;
+			background-size: 100% 30upx;
+			background-position: left bottom;
+			padding: 38upx 30upx 36upx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			.left{
+				width: 92%;
+				.name-box{
+					display: flex;
+					align-items: center;
+					.text{
+						font-size: 32upx;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #111111;
+						line-height: 1;
+						&.name{
+							margin-right: 30upx;
+						}
+					}
+				}
+				.address{
+					font-size: 28upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #666666;
+					line-height: 42upx;
+					text-align:left;
+					margin-top: 23upx;
+				}
+			}
+			.arrow-box{
+				width: 12upx;
+				height: 23upx;
+				display: flex;
+				align-items: cenetr;
+				justify-content: cenetr;
+				image{
+					width: 100%;
+					height: 100%;
+				}
+			}
+		}
+		.goods-list{
+			margin-top: 20upx;
+			padding: 0 30upx;
+			background-color: #FFFFFF;
+			border-radius: 16upx;
+			.item{
+				padding: 30upx 0;
+				border-bottom: 1px solid #EDEEEF;
+				display: flex;
+				align-items: center;
+				.img-box{
+					width: 160upx;
+					height: 160upx;
+					margin-right: 30upx;
+					image{
+						width: 100%;
+						height: 100%;
+					}
+				}
+				.info-box{
+					width: calc(100% - 190upx);
+					height: 160upx;
+					display: flex;
+					flex-direction: column;
+					justify-content: space-between;
+					.name-box{
+						font-size: 28upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #111111;
+						line-height: 40upx;
+						.tag{
+							display: inline-block;
+							padding: 0 6upx;
+							height: 30upx;
+							background: linear-gradient(90deg, #C39A58 0%, #C0DBFD 100%);
+							border-radius: 4upx;
+							margin-right: 10upx;
+							font-size: 22upx;
+							font-family: PingFang SC;
+							font-weight: bold;
+							color: #FFFFFF;
+							line-height: 30upx;
+							float: left;
+							margin-top: 7upx;
+						}
+					}
+					.spec{
+						margin-top: 10upx;
+						font-size: 24upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #999999;
+						line-height: 1;
+					}
+					.price-num{
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+						.price{
+							display: flex;
+							align-items: flex-end;
+							.unit{
+								font-size: 24upx;
+								font-family: PingFang SC;
+								font-weight: 500;
+								color: #111111;
+								line-height: 1.2;
+								margin-right: 4upx;
+							}
+							.num{
+								font-size: 32upx;
+								font-family: PingFang SC;
+								font-weight: 500;
+								color: #111111;
+								line-height: 1;
+							}
+						}
+						.num{
+							font-size: 24upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #999999;
+							line-height: 1;
+						}
+					}
+				}
+			}
+			.sub-total{
+				height: 88upx;
+				display: flex;
+				align-items: center;
+				justify-content: flex-end;
+				.label{
+					font-size: 24upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+				}
+				.price{
+					display: flex;
+					align-items: flex-end;
+					.unit{
+						font-size: 24upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #FF6633;
+						line-height: 1.2;
+						margin-right: 4upx;
+					}
+					.num{
+						font-size: 32upx;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #FF6633;
+						line-height: 1;
+					}
+				}
+			}
+		}
+		.other-info{
+			margin-top: 20upx;
+			background-color: #fff;
+			border-radius: 20upx;
+			overflow: hidden;
+			padding: 0 30upx;
+			.title{
+				height: 80upx;
+				line-height: 80upx;
+				font-size: 30upx;
+				color: #000;
+				font-weight: bold;
+				border-bottom: 2upx solid #eeeeee;
+			}
+			.item{
+				height: 80upx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				&:last-child{
+					border-bottom: none;
+				}
+				.left{
+					flex: 1;
+					display: flex;
+					align-items: center;
+					.label{
+						min-width: 140rpx;
+						font-size: 28upx;
+						color: #000;
+					}
+					.text{
+						font-size: 28upx;
+						color: #1b1b1b;
+					}
+				}
+				.right{
+					display: flex;
+					align-items: center;
+					justify-content: flex-end;
+					.text{
+						font-size: 28upx;
+						color: #1b1b1b;
+					}
+					.ic-close{
+						margin-left: 10rpx;
+						width: 30rpx;
+						height:30rpx;
+					}
+					.ic-back{
+						margin-left: 10rpx;
+						width: 15rpx;
+						height:30rpx;
+					}
+				}
+				.item-btn{
+					max-width: 200rpx;
+					padding: 0rpx 15rpx;
+					height: 48upx;
+					border-radius: 24upx;
+					line-height: 48upx;
+					font-size: 24upx;
+					color: #000;
+					border: 1upx solid #d8d8d8;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+				}
+			}
+		}
+		.remarks{
+			height: 88upx;
+			padding: 0 30upx;
+			background: #FFFFFF;
+			border-radius: 16upx;
+			margin-top: 20upx;
+			display: flex;
+			align-items: center;
+			input{
+				width: 100%;
+				font-size: 28upx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #000000;
+			}
+			.input{
+				font-size: 28upx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #999999;
+			}
+		}
+	}
+	
+	
+	.btn-box{
+	 	height: 140upx;
+	 	z-index: 99;
+	 	width: 100%;
+	 	padding: 0rpx 30upx;
+	 	position: fixed;
+	 	bottom: 0;
+	 	left: 0;
+	 	box-sizing: border-box;
+	 	background-color: #ffffff;
+	 	display: flex;
+	 	align-items: center;
+	 	justify-content: center;
+	 	.btn{
+	 		width: 100%;
+	 		height: 88upx;
+	 		line-height: 88upx;
+	 		text-align: center;
+	 		font-size: 34upx;
+	 		font-family: PingFang SC;
+	 		font-weight: 400;
+	 		color: #FFFFFF;
+	 		background: #2583EB;
+	 		border-radius: 10upx;
+	 	}
+	}
+	.pay-type{
+	 	box-sizing: border-box;
+	 	height: 192upx;
+	 	background: #FFFFFF;
+	 	border-radius: 16upx;
+	 	margin-top: 20upx;
+	 	padding: 40upx 30upx;
+	 	display: flex;
+	 	flex-direction: column;
+	 	justify-content: space-between;
+	 	.title{
+	 		font-size: 28upx;
+	 		font-family: PingFang SC;
+	 		font-weight: 500;
+	 		color: #999999;
+	 		line-height: 1;
+	 	}
+	 	.item{
+	 		display: flex;
+	 		align-items: center;
+	 		justify-content: space-between;
+	 		.left{
+	 			display: flex;
+	 			align-items: center;
+	 			image{
+	 				width: 44upx;
+	 				height: 44upx;
+	 				margin-right: 20upx;
+	 			}
+	 			.text{
+	 				font-size: 30upx;
+	 				font-family: PingFang SC;
+	 				font-weight: bold;
+	 				color: #222222;
+	 				line-height: 1;
+	 			}
+	 		}
+	 	}
+	}
+	.coupon{
+		height: 100%;
+		.empty{
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			height: 650rpx;
+			width: 100%;
+			image{
+				width: 280rpx;
+				height: 200rpx;
+			}
+		}
+	}
+	.coupon-box{
+		overflow-y: auto;
+		padding: 80rpx 20rpx 80rpx;
+		height: 650rpx;
+		width: 100%;
+		display: flex;
+		flex-direction: column;
+		align-items: flex-start;
+		justify-content: flex-start;
+		box-sizing: border-box;
+		.coupon-item{
+			width: 100%;
+			display: flex;
+			align-items: center;
+			justify-content: flex-start;
+			margin-bottom: 16rpx;
+			height:170rpx;
+			&:last-child{
+				margin-bottom: 0rpx;
+			}
+			.left{
+				 color: #fff;
+				font-size: 36rpx;
+				font-weight: bold;
+				text-align: center;
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				justify-content: center;
+				position: relative;
+				width: 230rpx;
+				image{
+					position: absolute;
+					width: 230rpx;
+					height:170rpx;
+					color: #fff;
+				}
+				.num{
+					font-size: 40rpx;
+				}
+				.pic-num{
+					font-size: 20rpx;
+					z-index: 99;
+				}
+			}
+			.right{
+				
+				display: flex;
+				flex-direction: column;
+				align-items: flex-start;
+				justify-content: flex-start;
+				height:170rpx;
+				width: calc(100% - 230rpx);
+				padding: 0 17rpx 0 24rpx;
+				background-color: #fff;
+				box-sizing: border-box;
+				.title{
+					width: 100%;
+					font-size: 0.3 * 100rpx;
+					color: #282828;
+					height: 0.93 * 100rpx;
+					line-height: 0.93 * 100rpx;
+					border-bottom: 1px solid #f0f0f0;
+				}
+				.btns{
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					width: 100%;
+					font-size: 0.2 * 100rpx;
+					color: #999;
+					height: 0.76 * 100rpx;
+					.btn{
+						width: 1.36 * 100rpx;
+						height: 0.44 * 100rpx;
+						border-radius: 0.22 * 100rpx;
+						font-size: 0.22 * 100rpx;
+						color: #fff;
+						text-align: center;
+						line-height: 0.44 * 100rpx;
+						background-color: #2583EB;
+						.gray{
+							 background-color: #ccc;
+						}
+					}
+					
+				}
+			}
+		}
+		
+	}
+</style>
+ 
+

+ 1 - 1
pages_user/integral.vue

@@ -100,7 +100,7 @@
 
 <script>
 	import {getDictByKey} from '@/api/common.js'
-	import {getUserSign,getUserIntegralLogsList,doSign} from '@/api/integral';
+	import {getUserSign,getUserIntegralLogsList,doSign} from './api/integral';
 	import Loading from "@/components/Loading";
 	export default {
 		components: {

+ 1069 - 0
pages_user/integral/refundOrder.vue

@@ -0,0 +1,1069 @@
+<template>
+	<view class="content">
+		<view class="inner">
+			<!-- 药品列表 -->
+			<view class="drug-list">
+				<view  class="item">
+					<!-- 药品信息 -->
+					<view class="drug-info" v-for="(item,index) in items" :key="index">
+						<view class="img-box">
+							<image :src="item.imgUrl" mode="aspectFit"></image>
+						</view>
+						<view class="info">
+							<view class="top">
+								<view class="title ellipsis2">{{item.goodsName||''}}</view>
+								<!-- <view class="spec">{{JSON.parse(item.jsonInfo).sku}}</view> -->
+							</view>
+							<view class="num-box">
+								<view class="price">
+									<text class="num" >{{item.integral}}</text>
+									<text class="unit">积分</text>
+									<text class="num" v-if="item.cash>0">+{{item.cash}}</text>
+									<text class="unit" v-if="item.cash>0">元</text>
+								</view>
+								<view class="amount">x{{item.num}}</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<!-- 申请类型 -->
+			<view class="reason-apply">
+				<view class="title-box">
+					<text class="label">申请类型</text>
+					<view class="radio-group">
+						<label class="radio" @click="changeRefundType(0)">
+							<radio :checked="refundType === 0" color="#2583EB" />仅退款
+						</label>
+						<label class="radio" @click="changeRefundType(1)">
+							<radio :checked="refundType === 1" color="#2583EB" />退货退款
+						</label>
+					</view>
+				</view>
+				<view class="title-box">
+					<text class="label">退款金额</text>
+					 <input class="money" type="text" disabled v-model="refundAmount" placeholder="退款金额" placeholder-class="form-input" />
+				</view>
+				<view class="title-box">
+					<text class="label">退回积分</text>
+					 <input class="money" type="text" disabled v-model="refundIntegral" placeholder="退回积分" placeholder-class="form-input" />
+				</view>
+				<view class="title-box">
+					<text class="label">申请原因</text>
+					<picker @change="reasonsChange" :value="reasonIndex"  range-key="dictLabel" :range="filteredReasonsList">
+						<view class="chose-box"  >
+							<text class="text">{{reasons}}</text>
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/arrow_gray.png" mode=""></image>
+						</view>
+					</picker>
+				</view>
+				<!-- <view class="upload-box">
+					<view class="upload-title">申请说明图片</view>
+					<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="6"></u-upload>
+				</view> -->
+				<view class="textarea-box">
+					<textarea v-model="explains" placeholder="请描述申请售后服务的具体原因" placeholder-class="textarea-place" />
+				</view>
+				<view v-if="isDeliveryReason" class="delivery-box">
+					<view class="logistics-select-container">
+						<view class="search-header">
+							<text class="label">物流公司</text>
+							<view class="search-input-wrapper">
+								<input class="search-input" type="text" v-model="logisticsKeyword" placeholder="搜索物流公司" placeholder-class="search-input-place" @input="onSearchInput" />
+								<image v-if="logisticsKeyword" class="clear-icon" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/close.png" @click="clearSearch"></image>
+							</view>
+							<text class="refresh-btn" :class="{'loading': logisticsLoading}" @click.stop="refreshLogisticsCompanies">{{logisticsLoading?'...':'刷新'}}</text>
+						</view>
+						
+						<view v-if="logisticsKeyword && !deliveryForm.shipper_code" class="results-dropdown">
+							<scroll-view scroll-y class="results-list">
+								<view v-for="(item, index) in logisticsCompanyList" :key="index" class="result-item" @click="selectLogistics(item)">
+									<text class="name">{{item.lcName}}</text>
+								</view>
+								<view v-if="!logisticsLoading && logisticsCompanyList.length === 0" class="empty-results">暂无结果</view>
+								<view v-if="logisticsLoading" class="loading-results">搜索中...</view>
+							</scroll-view>
+						</view>
+
+						<view v-if="deliveryForm.delivery_name && !logisticsKeyword" class="selected-display" @click="reselectLogistics">
+							<text class="name">{{deliveryForm.delivery_name}}</text>
+							<image class="arrow" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/arrow_gray.png"></image>
+						</view>
+					</view>
+					
+					<view class="title-box">
+						<text class="label">物流单号</text>
+						<input class="money logistics-input" type="text" v-model="deliveryForm.delivery_sn" placeholder="请输入物流单号" placeholder-class="form-input" />
+					</view>
+
+					<!-- 地址信息展示 -->
+					<view class="address-card" v-if="order">
+						<view class="address-item">
+							<view class="icon-box sender">寄</view>
+							<view class="content-box">
+								<view class="user-info">
+									<text class="name">{{order.realName || '寄件人'}}</text>
+									<text class="phone">{{order.userPhone || '-'}}</text>
+								</view>
+								<view class="address-text">{{order.userAddress || '-'}}</view>
+							</view>
+						</view>
+						
+						<view class="address-item" v-if="deliveryBaseInfo.address">
+							<view class="icon-box recipient">收</view>
+							<view class="content-box">
+								<view class="user-info">
+									<text class="name">{{deliveryBaseInfo.consignee || '-'}}</text>
+									<text class="phone">{{deliveryBaseInfo.phone_number || '-'}}</text>
+								</view>
+								<view class="address-text">{{deliveryBaseInfo.address || '-'}}</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<!-- 退回方式 -->
+			<!-- <view class="return-method">
+				<view class="title-box">
+					<text class="text">退货方式</text>
+					<text class="text">用户发货</text>
+				</view>
+				<view class="return-tips">
+					<text class="text">请您在审核通过后7天内,将商品发货到指定点</text>
+				</view>
+				<view class="info-item">
+					<text class="label">联系人</text>
+					<text class="text">张三  1572325612</text>
+				</view>
+				<view class="info-item">
+					<text class="label">发货地址</text>
+					<text class="text">重庆市江北区建玛特商场5楼</text>
+				</view>
+			</view> -->
+			 <!-- 底部按钮 -->
+			 <view class="btn-box">
+			 	<view class="sub-btn" @click="submit()">申请售后</view>
+			 </view>
+		</view>
+		
+	 
+	</view>
+</template>
+
+<script>
+	import {applyAfterSales,getMyStoreOrderItemByOrderId,editDelivery,getErpReturnInfo} from '../api/integralAfterSales.js'
+	import { queryLogisticsCompany,refreshLogisticsCompany } from '../api/storeAfterSales.js'
+	export default {
+		computed: {
+			isDeliveryReason() {
+				return this.reasonValue === '6';
+			}
+		},
+		data() {
+			return {
+				orderId:null,
+				order:null,
+				orderCode:null,
+				items:[],
+				type:null,
+				reasonsList:[],
+				reasons:"请选择",
+				reasonIndex:0,
+				reasonValue:null,
+				explains:"",
+				refundAmount:0.00,
+				refundIntegral: 0,
+				refundType: 0, // 0: 仅退款, 1: 退货退款
+				filteredReasonsList: [],
+				logisticsCompanyList:[],
+				logisticsKeyword:'',
+				selectedLogisticsIndex:0,
+				logisticsLoading:false,
+				searchTimer: null,
+				deliveryBaseInfo:{
+					consignee:'',
+					phone_number:'',
+					address:''
+				},
+				deliveryForm:{
+					shipper_code:'',
+					delivery_sn:'',
+					delivery_name:''
+				},
+				fileList1: [],
+				explainImg: ""
+			}
+		},
+		onLoad(option) {
+			this.type=option.type;
+			this.orderCode=option.orderCode;
+			this.reasonsList=this.$getDict("storeAfterSalesReasons");
+			this.orderId=option.orderId;
+			console.log(this.orderId);
+			// Initialize refundType based on option.type if available, otherwise default to 0
+			this.refundType = option.type !== undefined ? Number(option.type) : 0;
+			this.filterReasons(); // Filter reasons initially
+			this.getMyStoreOrderItemByOrderId()
+		},
+		methods: {
+			changeRefundType(type) {
+				this.refundType = type;
+				this.filterReasons();
+				// Reset selected reason when refund type changes
+				this.reasons = "请选择";
+				this.reasonIndex = 0;
+				this.reasonValue = null;
+				this.resetDeliveryForm();
+			},
+			filterReasons() {
+				if (this.refundType === 0) { // 仅退款类型type0
+					this.filteredReasonsList = this.reasonsList.filter(item => item.dictValue !== '6');
+				} else { // 退货退款类型type1
+					this.filteredReasonsList = this.reasonsList.filter(item => item.dictValue === '6');
+				}
+			},
+			getMyStoreOrderItemByOrderId(){
+				var data={orderId:this.orderId};
+				getMyStoreOrderItemByOrderId(data).then(res => {
+					if(res.code==200){
+						this.order=res.order;
+						this.items=res.items;
+						this.refundAmount= this.$formatNum(this.order.payMoney)
+						this.refundIntegral = this.order.integral || 0
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: "请求失败",
+						});
+						 
+					}
+				});
+			},
+			reasonsChange(e) {
+				var index = Number(e.detail.value);
+				var current = this.filteredReasonsList[index] || {};
+				this.reasonIndex = index;
+				this.reasons = current.dictLabel || '请选择';
+				this.reasonValue = current.dictValue != null ? current.dictValue.toString() : null;
+				if(this.isDeliveryReason){
+					this.loadLogisticsCompanies();
+					this.loadMerchantDeliveryInfo();
+				}else{
+					this.resetDeliveryForm();
+				}
+			},
+			resetDeliveryForm(){
+				this.selectedLogisticsIndex = 0;
+				this.deliveryForm = {
+					shipper_code:'',
+					delivery_sn:'',
+					delivery_name:''
+				};
+			},
+			loadMerchantDeliveryInfo(){
+				return getErpReturnInfo().then(res => {
+					if(res.code==200){
+						this.deliveryBaseInfo = {
+							consignee: res.returnReceiver || '',
+							phone_number: res.returnPhone || '',
+							address: res.returnAddress || ''
+						};
+						return this.deliveryBaseInfo;
+					}
+					uni.showToast({
+						icon:'none',
+						title: res.msg || '获取商家收货信息失败'
+					});
+					return null;
+				});
+			},
+			loadLogisticsCompanies(forceRefresh){
+				if(this.logisticsLoading){
+					return;
+				}
+				if(!forceRefresh&&this.logisticsCompanyList.length>0&&!this.logisticsKeyword){
+					return;
+				}
+				this.logisticsLoading = true;
+				queryLogisticsCompany({keyword:this.logisticsKeyword}).then(res => {
+					if(res.code==0||res.code==200){
+						var list = [];
+						if(Array.isArray(res.data)){
+							list = res.data;
+						}else if(Array.isArray(res.rows)){
+							list = res.rows;
+						}else if(Array.isArray(res.list)){
+							list = res.list;
+						}
+						this.logisticsCompanyList = list;
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: res.msg || '物流公司获取失败'
+						});
+					}
+				}).finally(() => {
+					this.logisticsLoading = false;
+				});
+			},
+			onSearchInput() {
+				if (this.searchTimer) {
+					clearTimeout(this.searchTimer);
+				}
+				this.deliveryForm.shipper_code = ''; // 重置选中状态以显示列表
+				this.searchTimer = setTimeout(() => {
+					this.loadLogisticsCompanies(true);
+				}, 500);
+			},
+			clearSearch() {
+				this.logisticsKeyword = '';
+				this.logisticsCompanyList = [];
+				this.resetDeliveryForm();
+			},
+			selectLogistics(item) {
+				this.deliveryForm.shipper_code = item.lcId || '';
+				this.deliveryForm.delivery_name = item.lcName || '';
+				this.logisticsKeyword = ''; // 清空搜索词以显示选中状态
+				this.logisticsCompanyList = [];
+			},
+			reselectLogistics() {
+				this.logisticsKeyword = this.deliveryForm.delivery_name;
+				this.deliveryForm.shipper_code = '';
+				this.onSearchInput();
+			},
+			searchLogisticsCompanies(){
+				this.loadLogisticsCompanies(true);
+			},
+			refreshLogisticsCompanies(){
+				refreshLogisticsCompany({}).then(res => {
+					if(res.code==0||res.code==200){
+						this.logisticsCompanyList = [];
+						this.loadLogisticsCompanies(true);
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: res.msg || '刷新失败'
+						});
+					}
+				});
+			},
+			validateDeliveryForm(){
+				if(!this.deliveryForm.shipper_code||!this.deliveryForm.delivery_name){
+					uni.showToast({
+						icon:'none',
+						title: '请选择物流公司'
+					});
+					return false;
+				}
+				if(!this.deliveryForm.delivery_sn){
+					uni.showToast({
+						icon:'none',
+						title: '请输入物流单号'
+					});
+					return false;
+				}
+				return true;
+			},
+			buildDeliveryPayload(){
+				if(!this.deliveryBaseInfo.consignee||!this.deliveryBaseInfo.phone_number||!this.deliveryBaseInfo.address){
+					return null;
+				}
+				return {
+					orderCode:this.orderCode,
+					consignee:this.deliveryBaseInfo.consignee,
+					phone_number:this.deliveryBaseInfo.phone_number,
+					address:this.deliveryBaseInfo.address,
+					shipper_code:this.deliveryForm.shipper_code,
+					delivery_sn:this.deliveryForm.delivery_sn,
+					delivery_name:this.deliveryForm.delivery_name
+				};
+			},
+			handleSubmitSuccess(message){
+				uni.showToast({
+					icon:'success',
+					title: message || '提交成功'
+				});
+				setTimeout(function() {
+					uni.$emit('refreshOrder');
+					uni.navigateBack({
+						delta: 1
+					})
+				}, 500);
+			},
+			deletePic(event) {
+				this[`fileList${event.name}`].splice(event.index, 1)
+			},
+			async afterRead(event) {
+				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				let fileListLen = this[`fileList${event.name}`].length
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url)
+					let item = this[`fileList${event.name}`][fileListLen]
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: result.status,
+						message: result.status == 'failed' ? '上传失败' : '',
+						url: result.url
+					}))
+					fileListLen++
+				}
+			},
+			getSuccessUrls(list) {
+				if (!list || list.length === 0) return '';
+
+				const hasUploading = list.some(v => v.status === 'uploading');
+				const hasFailed = list.some(v => v.status === 'failed');
+
+				if (hasUploading) {
+					uni.showToast({
+						title: '请等待图片上传完成',
+						icon: 'none'
+					});
+					return 'failed';
+				}
+				if (hasFailed) {
+					uni.showToast({
+						title: '请检查是否有图片上传失败',
+						icon: 'none'
+					});
+					return 'failed';
+				}
+
+				return list.filter(v => v.status === 'success').map(v => v.url).join(',');
+			},
+			uploadFilePromise(url) {
+				return new Promise((resolve, reject) => {
+					let a = uni.uploadFile({
+						url: uni.getStorageSync('requestPath') + '/app/common/uploadOSS', // 仅为示例,非真实的接口地址
+						filePath: url,
+						name: 'file',
+						success: (res) => {
+							if (res.statusCode == 200 && JSON.parse(res.data).code == 200) {
+								resolve({
+									url: JSON.parse(res.data).url,
+									status: 'success'
+								})
+							} else {
+								resolve({
+									url: url,
+									status: 'failed'
+								})
+							}
+						},
+						fail: (res) => {
+							resolve({
+								url: url,
+								status: 'failed'
+							})
+						}
+					});
+				})
+			},
+			async submit(){
+				if(this.reasons=="请选择"){
+					uni.showToast({
+						icon:'none',
+						title: '请选择原因'
+					});
+					return;
+				}
+				if(this.refundAmount<0){
+					uni.showToast({
+						icon:'none',
+						title: '请输入退款金额'
+					});
+					return;
+				}
+
+				const images = this.getSuccessUrls(this.fileList1);
+				if (images === 'failed') return;
+				this.explainImg = images;
+
+				var productIds=this.items.map(item=>item.productId);
+				var products=[];
+				for(var i=0;i<productIds.length;i++){
+					var item={productId:productIds[i]};
+					products.push(item);
+				}
+				var afterSalesData={
+					refundAmount:this.refundAmount,
+					refundIntegral:this.refundIntegral,
+					orderCode:this.orderCode,
+					serviceType:this.refundType,
+					reasons:this.reasons,
+					explains:this.explains,
+					explainImg: this.explainImg,
+					// productList:products,
+				};
+
+				if (this.isDeliveryReason) {
+					// 如果原因是物流相关(dictValue为6)
+					if (!this.validateDeliveryForm()) {
+						return;
+					}
+
+					// 1. 先获取商家收货地址
+					await this.loadMerchantDeliveryInfo();
+					var deliveryData = this.buildDeliveryPayload();
+					if (!deliveryData) {
+						uni.showToast({
+							icon: 'none',
+							title: '商家收货信息不完整'
+						});
+						return;
+					}
+
+					// 2. 合并参数:售后数据 + 物流数据
+					let finalSubmitData = {
+						...afterSalesData,   // 原售后参数
+						...deliveryData     // 物流信息(已合并)
+					};
+
+					// 3. 只调用一个接口:applyAfterSales
+					var res = await applyAfterSales(finalSubmitData);
+					if (res.code === 200) {
+						this.handleSubmitSuccess('提交成功');
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg || '提交失败'
+						});
+					}
+				}else{
+					// 如果不是物流相关,直接调用申请售后接口
+					var res = await applyAfterSales(afterSalesData);
+					if(res.code==200){
+						this.handleSubmitSuccess('提交成功');
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: res.msg
+						});
+					}
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.content{
+		margin-bottom: 170upx;
+		.inner{
+			padding: 20upx;
+			.drug-list{
+				.item{
+					background: #FFFFFF;
+					border-radius: 16upx;
+					margin-bottom: 20upx;
+					padding: 0 30upx;
+					.drug-info{
+						display: flex;
+						align-items: center;
+						padding: 30upx 0;
+						.img-box{
+							width: 160upx;
+							height: 160upx;
+							margin-right: 30upx;
+							image{
+								width: 100%;
+								height: 100%;
+							}
+						}
+						.info{
+							width: calc(100% - 160upx);
+							height: 160upx;
+							display: flex;
+							flex-direction: column;
+							justify-content: space-between;
+							.top{
+								.title{
+									font-size: 28upx;
+									font-family: PingFang SC;
+									font-weight: 500;
+									color: #111111;
+									line-height: 1.4;
+									.tag{
+										display: inline-block;
+										padding: 0 6upx;
+										height: 30upx;
+										background: linear-gradient(90deg, #2583EB 0%, #2BC7A4 100%);
+										border-radius: 4upx;
+										margin-right: 10upx;
+										font-size: 22upx;
+										font-family: PingFang SC;
+										font-weight: bold;
+										color: #FFFFFF;
+										line-height: 30upx;
+										float: left;
+										margin-top: 7upx;
+									}
+								}
+								.spec{
+									font-size: 24upx;
+									font-family: PingFang SC;
+									font-weight: 500;
+									color: #999999;
+									line-height: 1;
+									margin-top: 14upx;
+								}
+							}
+						}
+					}
+					 
+				}
+			}
+			.reason-apply{
+				margin-top: 20upx;
+				background: #FFFFFF;
+				border-radius: 16upx;
+				padding: 0 30upx;
+				.title-box{
+					height: 86upx;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					border-bottom: 1px solid #F0F0F0;
+					.label{
+						font-size: 30upx;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #333333;
+					}
+					.radio-group {
+						display: flex;
+						.radio {
+							display: flex;
+							align-items: center;
+							margin-right: 40upx;
+							font-size: 28upx;
+							color: #333333;
+							radio {
+								transform:scale(0.7);
+							}
+						}
+					}
+					.money{
+						
+						font-size: 24upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #999999;
+					}
+					.chose-box{
+						display: flex;
+						align-items: center;
+						.text{
+							font-size: 24upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #999999;
+						}
+						image{
+							width: 14upx;
+							height: 24upx;
+							margin-left: 10upx;
+						}
+					}
+				}
+				.upload-box{
+					padding: 20upx 0;
+					.upload-title{
+						font-size: 30upx;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #333333;
+						margin-bottom: 20upx;
+					}
+				}
+				.textarea-box{
+					padding: 30upx 0;
+					textarea{
+						width: 100%;
+						box-sizing: border-box;
+						background: #F5F5F5;
+						border-radius: 16upx;
+						padding: 30upx 20upx;
+						font-size: 24upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #111111;
+					}
+					.textarea-place{
+						font-size: 24upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #999999;
+					}
+				}
+				.delivery-box{
+					border-top: 1px solid #F0F0F0;
+					padding-top: 20upx;
+					.logistics-select-container {
+						position: relative;
+						margin-bottom: 20upx;
+						
+						.search-header {
+							display: flex;
+							align-items: center;
+							height: 86upx;
+							border-bottom: 1px solid #F0F0F0;
+							
+							.label {
+								font-size: 30upx;
+								font-family: PingFang SC;
+								font-weight: bold;
+								color: #333333;
+								width: 160upx;
+							}
+							
+							.search-input-wrapper {
+								flex: 1;
+								position: relative;
+								display: flex;
+								align-items: center;
+								
+								.search-input {
+									width: 100%;
+									height: 60upx;
+									font-size: 26upx;
+									color: #333333;
+									text-align: left;
+									padding-right: 50upx;
+								}
+								
+								.clear-icon {
+									position: absolute;
+									right: 10upx;
+									width: 32upx;
+									height: 32upx;
+									z-index: 10;
+								}
+							}
+							
+							.refresh-btn {
+								font-size: 24upx;
+								color: #2583EB;
+								margin-left: 20upx;
+								min-width: 60upx;
+								text-align: center;
+								
+								&.loading {
+									opacity: 0.6;
+								}
+							}
+						}
+						
+						.results-dropdown {
+							position: absolute;
+							top: 86upx;
+							left: 0;
+							right: 0;
+							background: #FFFFFF;
+							box-shadow: 0 4upx 20upx rgba(0,0,0,0.1);
+							border-radius: 8upx;
+							z-index: 100;
+							max-height: 400upx;
+							overflow: hidden;
+							
+							.results-list {
+								max-height: 400upx;
+								
+								.result-item {
+									padding: 24upx 30upx;
+									border-bottom: 1px solid #F8F8F8;
+									
+									&:active {
+										background-color: #F5F5F5;
+									}
+									
+									.name {
+										font-size: 28upx;
+										color: #333333;
+									}
+								}
+								
+								.empty-results, .loading-results {
+									padding: 40upx;
+									text-align: center;
+									font-size: 24upx;
+									color: #999999;
+								}
+							}
+						}
+						
+						.selected-display {
+							display: flex;
+							align-items: center;
+							justify-content: space-between;
+							height: 80upx;
+							background: #F8F8F8;
+							border-radius: 8upx;
+							padding: 0 20upx;
+							margin-top: 10upx;
+							
+							.name {
+								font-size: 28upx;
+								color: #2583EB;
+								font-weight: 500;
+							}
+							
+							.arrow {
+								width: 12upx;
+								height: 20upx;
+							}
+						}
+					}
+					
+					.logistics-input{
+						flex: 1;
+					}
+
+					.address-card {
+						padding: 20upx 0;
+						background: #FFFFFF;
+
+						.address-item {
+							display: flex;
+							align-items: flex-start;
+							padding: 30upx 0;
+							border-bottom: 1upx solid #F5F5F5;
+							&:last-child {
+								border-bottom: none;
+							}
+
+							.icon-box {
+								width: 44upx;
+								height: 44upx;
+								border-radius: 8upx;
+								display: flex;
+								align-items: center;
+								justify-content: center;
+								font-size: 24upx;
+								font-weight: bold;
+								color: #FFFFFF;
+								margin-top: 6upx;
+								flex-shrink: 0;
+
+								&.sender {
+									background: #FF5A1F;
+								}
+
+								&.recipient {
+									background: #FFB400;
+								}
+							}
+
+							.content-box {
+								flex: 1;
+								margin-left: 20upx;
+
+								.user-info {
+									margin-bottom: 12upx;
+									display: flex;
+									align-items: center;
+
+									.name {
+										font-size: 30upx;
+										font-weight: bold;
+										color: #111111;
+										margin-right: 20upx;
+									}
+
+									.phone {
+										font-size: 30upx;
+										font-weight: bold;
+										color: #111111;
+									}
+								}
+
+								.address-text {
+									font-size: 26upx;
+									color: #666666;
+									line-height: 1.4;
+									word-break: break-all;
+								}
+							}
+						}
+					}
+				}
+			}
+			.return-method{
+				background: #FFFFFF;
+				border-radius: 16upx;
+				margin-top: 20upx;
+				padding: 0 30upx 40upx;
+				.title-box{
+					height: 86upx;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					border-bottom: 1px solid #F0F0F0;
+					.text{
+						font-size: 30upx;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #333333;
+					}
+				}
+				.return-tips{
+					margin-top: 30upx;
+					margin-bottom: 30upx;
+					height: 80upx;
+					background: #FFF4E6;
+					border-radius: 16upx;
+					padding: 0 20upx;
+					display: flex;
+					align-items: center;
+					.text{
+						font-size: 24upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #EF8A07;
+					}
+				}
+				.info-item{
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					margin-bottom: 40upx;
+					&:last-child{
+						margin-bottom: 0;
+					}
+					.label{
+						font-size: 26upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #666666;
+						line-height: 1;
+					}
+					.text{
+						font-size: 26upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #111111;
+						line-height: 1;
+					}
+					.detail-box{
+						display: flex;
+						align-items: center;
+						.price-box{
+							display: flex;
+							align-items: flex-end;
+							margin-right: 18upx;
+							.unit{
+								font-size: 24upx;
+								font-family: PingFang SC;
+								font-weight: 500;
+								color: #111111;
+								line-height: 1.2;
+							}
+							.num{
+								font-size: 32upx;
+								font-family: PingFang SC;
+								font-weight: bold;
+								color: #111111;
+								line-height: 1;
+							}
+						}
+						.det-text{
+							font-size: 26upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #111111;
+						}
+						image{
+							width: 14upx;
+							height: 24upx;
+							margin-left: 10upx;
+						}
+					}
+				}
+			}
+		}
+		 
+		.reson-box{
+			padding: 0 10upx 60upx;
+			.reson-item{
+				width: 100%;
+				height: 110upx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				.title{
+					font-size: 30upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #111111;
+				}
+			}
+		}
+	}
+	.btn-box{
+		height: 120upx;
+		padding: 0 30upx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		.sub-btn{
+			width: 100%;
+			height: 88upx;
+			line-height: 88upx;
+			text-align: center;
+			font-size: 30upx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #FFFFFF;
+			background: #2583EB;
+			border-radius: 44upx;
+		}
+	}
+	input{
+		text-align: right;
+	}
+	.form-input{
+		font-size: 30upx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #999999;
+		text-align: right;
+	}
+	.num-box{
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		.price{
+			display: flex;
+			align-items: flex-end;
+			.unit{
+				font-size: 24upx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #111111;
+				line-height: 1.2;
+				margin-right: 4upx;
+			}
+			.num{
+				font-size: 32upx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #111111;
+				line-height: 1;
+			}
+		}
+		.amount{
+			font-size: 24upx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #999999;
+			line-height: 1;
+		}
+	}
+</style>

+ 146 - 0
pages_user/integral/refundOrderDelivery.vue

@@ -0,0 +1,146 @@
+<template>
+  <view class="content">
+  	<view class="inner">
+  		<view class="form-box">
+  			<view class="form-item">
+  				<text class="label">快递公司</text>
+  				<input type="text" v-model="form.deliveryName" placeholder="请输入物流公司" placeholder-class="form-input" />
+  			</view>
+  			<view class="form-item">
+  			 	<text class="label">快递单号</text>
+  			 	<input type="text" v-model="form.deliverySn"   placeholder="请输入物流单号" placeholder-class="form-input" />
+  			</view>
+  		</view>
+  	</view>
+  	<view class="btn-box">
+  		<view class="sub-btn" @click="submit()">提交</view>
+  	</view>
+  </view>
+</template>
+
+<script>
+import {addDelivery} from '../api/integralAfterSales.js'
+	
+export default {
+  data() {
+    return {
+		form:{
+			salesId:null,
+			deliverySn:null,
+			deliveryName:null,
+		}
+    }
+  },
+  onLoad(option) {
+	  this.form.salesId=option.salesId
+  },
+  methods: {
+	submit(){
+		if(this.form.deliveryName==null){
+			uni.showToast({
+				icon:'none',
+				title: '请输入快递公司'
+			});
+			return;
+		}
+		if(this.form.deliverySn==null){
+			uni.showToast({
+				icon:'none',
+				title: '请输入快递单号'
+			});
+			return;
+		}
+	 	addDelivery(this.form).then(
+	 		res => {
+	 			if(res.code==200){
+	 				 uni.showToast({
+	 				 	icon:'success',
+	 				 	title: "提交成功",
+	 				 });
+					 uni.navigateBack({
+					 	delta: 1
+					 })
+	 			}else{
+	 				uni.showToast({
+	 					icon:'none',
+	 					title: res.msg,
+	 				});
+	 			}
+	 		},
+	 		rej => {}
+	 	);
+	 },
+  },
+  
+}
+</script>
+
+<style lang="scss">
+	page{
+		height: 100%;
+	}
+	.content{
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+		
+		.inner{
+			padding: 20upx;
+			.form-box{
+				padding: 0 30upx;
+				background: #FFFFFF;
+				border-radius: 16upx;
+				.form-item{
+					padding: 30upx 0;
+					display: flex;
+					align-items: flex-start;
+					border-bottom: 1px solid #F1F1F1;
+					&:last-child{
+						border-bottom: none;
+					}
+					.label{
+						width: 150upx;
+						text-align: left;
+						font-size: 30upx;
+						line-height: 44upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #222222;
+						flex-shrink: 0;
+					}
+					input{
+						text-align: left;
+					}
+					.form-input{
+						font-size: 30upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #999999;
+						text-align: left;
+					}
+					 
+				}
+			}
+			 
+		}
+		.btn-box{
+			height: 120upx;
+			padding: 0 30upx;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			.sub-btn{
+				width: 100%;
+				height: 88upx;
+				line-height: 88upx;
+				text-align: center;
+				font-size: 30upx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #FFFFFF;
+				background: #2583EB;
+				border-radius: 44upx;
+			}
+		}
+	}
+</style>

+ 641 - 0
pages_user/integral/refundOrderDetail.vue

@@ -0,0 +1,641 @@
+<template>
+	<view>
+		<view class="top-cont">
+			<!-- 背景图片 -->
+			<view class="bg-color"></view>
+			<!-- <image class="bg" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/order_top_bg.png" mode=""></image> -->
+			<view class="top-inner">			
+				<!-- 这里是状态栏 -->
+				<view class="fixed-top-box">
+					<view class="status_bar" :style="{height: statusBarHeight}"></view>
+					<view class="back-box" @click="back">
+						<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/back_white.png" mode=""></image>
+						<text class="title">售后详情</text>
+						<text></text>
+					</view>
+				</view>
+				
+				<!-- 顶部固定后站位元素 -->
+				<view style="padding-bottom: 88upx;">
+					<view :style="{height: statusBarHeight}"></view>
+				</view>
+				<!-- 订单状态 -->
+				<view class="order-status" >
+					<!-- 处理中 -->
+					<view  v-if="sales.salesStatus == 0" class="inner">
+						<view class="img-box">
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/deal96.png" mode=""></image>
+						</view>
+						<view class="status-box">
+							<text class="status">售后中</text>
+							<text class="desc">请等待客服处理...</text>
+						</view>
+					</view>
+					<view  v-if="sales.salesStatus == 1" class="inner">
+						<view class="img-box">
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/close_trade.png" mode=""></image>
+						</view>
+						<view class="status-box">
+							<text class="status">售后取消</text>
+							<text class="desc">用户已取消售后</text>
+						</view>
+					</view>
+					<view  v-if="sales.salesStatus == 2" class="inner">
+						<view class="img-box">
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/close_trade.png" mode=""></image>
+						</view>
+						<view class="status-box">
+							<text class="status">售后取消</text>
+							<text class="desc">商家已拒绝...</text>
+						</view>
+					</view>
+					<!-- 退款成功 -->
+					<view  v-if="sales.salesStatus == 3" class="inner">
+						<view class="img-box">
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/compel96.png" mode=""></image>
+						</view>
+						<view class="status-box">
+							<text class="status">退款成功</text>
+							<text class="desc">已退款,退款金额将按原支付退回</text>
+						</view>
+					</view>
+					
+				</view>
+				<!-- 退款信息 -->
+				<view class="refund-info">
+					<view class="inner">
+						<view class="title-box">
+							<view class="left">
+								<text class="title">退款金额</text>
+								<view class="price-box">
+									<text class="unit">¥</text>
+									<text class="num" v-if="sales.refundAmount!=null">{{sales.refundAmount.toFixed(2)}}</text>
+								</view>
+							</view>
+							<view class="right">
+								<text class="text" v-if="sales.salesStatus==0">
+										<text  class="text success">{{$getDictLabelName("storeAfterSalesStatus",sales.status)}}</text>
+								</text>
+							</view>
+						</view>
+			 
+						<view class="refund-item" v-if="sales.status>=1&&sales.serviceType==1">
+							<view class="text">收件人:{{sales.consignee}} </view>
+							<view class="text">电话:{{sales.address}} </view>
+							<view class="text">收件地址:{{sales.phoneNumber}}</view>
+						</view>
+						<view class="btn-box"  v-if="sales.salesStatus==0" >
+							<view  v-if="sales.status==1" class="btn cancel" @click="addDeliverySn()"  >填写物流</view>
+							<view  v-if="sales.status==0||sales.status==1" class="btn cancel" @click="revoke()"  >撤销申请</view>
+							<!-- <view  class="btn cancel" @click="showLogs()" >查看进度</view> -->
+						</view>
+						<view class="refund-item" v-if="sales.status==0">
+							<view class="text">已提交等待平台审核 </view>
+						</view>
+						<view class="refund-item" v-if="sales.status==1">
+							<view class="text">平台已审核,等待用户发货 </view>
+						</view>
+						 <view class="refund-item" v-if="sales.status==2">
+						 	<view class="text">用户已发货,等待仓库审核 </view>
+						 </view>
+						 <view class="refund-item" v-if="sales.status==3">
+						 	<view class="text">财务审核 </view>
+						 </view>
+						 <view class="refund-item" v-if="sales.status==4">
+						 	<view class="text">已完成 </view>
+						 </view>
+					</view>
+				</view>
+				<view class="content">
+					<!-- 退货信息 -->
+					<view class="return-info">
+						<!-- <view class="title-box">
+							<text class="label">退货信息</text>
+							<text class="ret-num">共2件</text>
+						</view> -->
+						<!-- 退货列表 -->
+						<view class="goods-list">
+							<view v-for="(item,index) in items" :key="index" class="item">
+								<view class="img-box">
+									<image :src="item.imgUrl" mode="aspectFill"></image>
+								</view>
+								<view class="info-box">
+									<view>
+										<view class="title ellipsis2">{{item.goodsName||''}}</view>
+										<!-- <view class="spec">规格:{{JSON.parse(item.jsonInfo).sku}}</view> -->
+									</view>
+									<view class="num-box">
+										<view class="price">
+											<text class="num" >{{item.integral}}</text>
+											<text class="unit">积分</text>
+											<text class="num" v-if="item.cash>0">+{{item.cash}}</text>
+											<text class="unit" v-if="item.cash>0">元</text>
+										</view>
+										<view class="amount">x{{item.num}}</view>
+									</view>
+								</view>
+							</view>
+							<!-- 详细信息 -->
+							<view class="refund-det-info">
+								<view class="det-item">
+									<text class="label">退货原因</text>
+									<text class="text">{{sales.reasons}}</text>
+								</view>
+								<view class="det-item">
+									<text class="label">退货说明</text>
+									<text class="text">{{sales.explains}}</text>
+								</view>
+								<view class="det-item">
+									<text class="label">退款金额</text>
+									<text class="text" v-if="sales.refundAmount!=null">¥{{sales.refundAmount.toFixed(2)}}</text>
+								</view>
+								<view class="det-item">
+									<text class="label">退还积分</text>
+									<text class="text" v-if="sales.refundIntegral!=null">¥{{sales.refundIntegral||0}}</text>
+								</view>
+								 <view class="det-item">
+								 	<text class="label">订单编号</text>
+									<view class="sn-box">
+										<text class="text">{{sales.orderCode}}</text>
+										<view class="copy-btn" @click="copyOrderSn(sales.orderCode)">复制</view>
+									</view>
+								 </view>
+								<view class="det-item">
+									<text class="label">申请时间</text>
+									<text class="text">{{sales.createTime}}</text>
+								</view>
+								
+							</view>
+						</view>
+					</view>
+				</view>
+			
+			</view>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	import {getAfterSalesDetails,revoke} from '../api/integralAfterSales.js'
+	export default {
+		data() {
+			return {
+				modalTitle:"请输入快递单号",
+				sales:{},
+				items:[],
+				salesId:null,
+				// 状态栏的高度
+				statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
+ 
+			};
+		},
+		onLoad(option) {
+			this.salesId = option.salesId
+
+		},
+		onShow() {
+			this.getAfterSalesDetails()
+		},
+		methods: {
+			// 复制订单编号
+			copyOrderSn(text) {
+				// 复制方法
+				uni.setClipboardData({
+					data:text,
+					success:()=>{
+						uni.showToast({
+							title:'内容已成功复制到剪切板',
+							icon:'none'
+						})
+					}
+				});
+			},
+			addDeliverySn(){
+				uni.navigateTo({
+					url: './refundOrderDelivery?salesId=' + this.salesId
+				}) 
+			},
+			revoke(){
+				var data={id:this.salesId};
+				revoke(data).then(res => {
+					if(res.code==200){
+						 uni.showToast({
+						 	icon:'success',
+						 	title:'操作成功'
+						 });
+						 setTimeout(function() {
+							 uni.$emit('refreshAfterSales');
+							 uni.navigateBack({
+								 delta: 1
+							 })
+						 }, 500);
+						 
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: res.msg
+						});
+						 
+					}
+				});
+			},
+			getAfterSalesDetails() {
+				//联网加载数据
+				var that = this;
+				var data = {
+					salesId:this.salesId,
+
+				};
+				getAfterSalesDetails(data).then(res => {
+					if(res.code==200){
+						//设置列表数据
+						 this.sales=res.sales;
+						 this.items=res.items;
+						
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: res.msg
+						});
+						 
+					}
+				});
+			},
+			// 返回上一页
+			back() {
+				uni.navigateBack()
+			},
+			showLogs(status) {
+				uni.navigateTo({
+					url: './refundOrderLogs?orderStatus=' + status
+				})
+			},
+			
+		}
+	}
+</script>
+
+<style lang="scss">
+	.bg-color {
+		width: 100%;
+		background: linear-gradient(to right, #2583EB 0%, #60CDC3 100%);
+		height: 450rpx;
+	}
+	.fixed-top-box{
+		width: 100%;
+		background: linear-gradient(to right, #2583EB 0%, #60CDC3 100%);
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 1000;
+	}
+	.top-cont{
+		width: 100%;
+		height: 500upx;
+		position: relative;
+		.bg{
+			width: 100%;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: 1;
+		}
+		.top-inner{
+			width: 100%;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: 2;
+			.back-box{
+				height: 88upx;
+				padding-left: 22upx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				padding: 0 20upx;
+				image{
+					width: 40upx;
+					height: 40upx;
+				}
+				.title{
+					font-size: 36upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #FFFFFF;
+				}
+			}
+			.order-status{
+				margin-top: 60upx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				padding: 0 30upx;
+				.inner{
+					display: flex;
+					align-items: center;
+					.img-box{
+						width: 96upx;
+						height: 96upx;
+						margin-right: 30upx;
+						image{
+							width: 100%;
+							height: 100%;
+						}
+					}
+					.status-box{
+						height: 96upx;
+						display: flex;
+						flex-direction: column;
+						justify-content: center;
+						.status{
+							font-size: 40upx;
+							font-family: PingFang SC;
+							font-weight: bold;
+							color: #FFFFFF;
+							line-height: 1;
+						}
+						.desc{
+							font-size: 26upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #FFFFFF;
+							line-height: 1;
+							margin-top: 30upx;
+						}
+						.det-box{
+							display: flex;
+							align-items: center;
+							image{
+								width: 14upx;
+								height: 24upx;
+								margin-left: 12upx;
+								margin-top: 30upx;
+							}
+						}
+					}
+				}
+			}
+			.refund-info{
+				margin-top: 50upx;
+				padding: 0 20upx;
+				.inner{
+					
+					background: #FFFFFF;
+					border-radius: 16upx;
+					padding: 0 30upx 15upx 30upx;
+					.title-box{
+						height: 88upx;
+						border-bottom: 1px solid #F0F0F0;
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+						.left{
+							display: flex;
+							align-items: center;
+							.title{
+								font-size: 30upx;
+								font-family: PingFang SC;
+								font-weight: bold;
+								color: #333333;
+								line-height: 1;
+								margin-right: 20upx;
+							}
+							.price-box{
+								display: flex;
+								align-items: flex-end;
+								.unit{
+									font-size: 24upx;
+									font-family: PingFang SC;
+									font-weight: 500;
+									color: #FF6633;
+									line-height: 1.2;
+									margin-right: 4upx;
+								}
+								.num{
+									font-size: 32upx;
+									font-family: PingFang SC;
+									font-weight: bold;
+									color: #FF6633;
+									line-height: 1;
+								}
+							}
+						}
+						.right{
+							display: flex;
+							align-items: center;
+							.text{
+								font-size: 24upx;
+								font-family: PingFang SC;
+								font-weight: 500;
+								color: #999999;
+								line-height: 1;
+								margin-right: 10upx;
+							}
+							image{
+								width: 12upx;
+								height: 22upx;
+							}
+						}
+					}
+					.refund-item{
+						margin-top: 40upx;
+						.text{
+							margin-bottom: 10upx;
+							font-size: 26upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #666666;
+							line-height: 1;
+						}
+					}
+				}
+			}
+		}
+	}
+	.content{
+		padding: 0 20upx 20upx;
+		.return-info{
+			margin-top: 30upx;
+			background: #FFFFFF;
+			border-radius: 16upx;
+			.title-box{
+				height: 88upx;
+				padding: 0 30upx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				.label{
+					font-size: 30upx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #333333;
+				}
+				.ret-num{
+					font-size: 26upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+				}
+			}
+			.goods-list{
+				padding: 0 30upx;
+				background-color: #FFFFFF;
+				border-radius: 16upx;
+				.item{
+					padding: 30upx 0;
+					border-bottom: 1px solid #EDEEEF;
+					display: flex;
+					align-items: center;
+					.img-box{
+						width: 160upx;
+						height: 160upx;
+						margin-right: 30upx;
+						image{
+							width: 100%;
+							height: 100%;
+						}
+					}
+					.info-box{
+						width: calc(100% - 190upx);
+						height: 160upx;
+						display: flex;
+						flex-direction: column;
+						justify-content: space-between;
+						.title{
+							font-size: 28upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #333333;
+							line-height: 36upx;
+							.tag{
+								display: inline-block;
+								padding: 0 6upx;
+								height: 30upx;
+								background: linear-gradient(90deg, #2583EB 0%, #2BC7A4 100%);
+								border-radius: 4upx;
+								margin-right: 10upx;
+								font-size: 22upx;
+								font-family: PingFang SC;
+								font-weight: bold;
+								color: #FFFFFF;
+								line-height: 30upx;
+								float: left;
+								margin-top: 7upx;
+							}
+						}
+						.spec{
+							margin-top: 18upx;
+							font-size: 24upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #999999;
+							line-height: 1;
+						}
+						.num-box{
+							display: flex;
+							align-items: center;
+							justify-content: space-between;
+							.price{
+								display: flex;
+								align-items: flex-end;
+								.unit{
+									font-size: 24upx;
+									font-family: PingFang SC;
+									font-weight: 500;
+									color: #111111;
+									line-height: 1.2;
+									margin-right: 4upx;
+								}
+								.num{
+									font-size: 32upx;
+									font-family: PingFang SC;
+									font-weight: 500;
+									color: #111111;
+									line-height: 1;
+								}
+							}
+							.amount{
+								font-size: 24upx;
+								font-family: PingFang SC;
+								font-weight: 500;
+								color: #999999;
+								line-height: 1;
+							}
+						}
+					}
+				}
+				.refund-det-info{
+					padding-bottom: 30upx;
+					.det-item{
+						margin-top: 40upx;
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+						.label{
+							font-size: 26upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #666666;
+							line-height: 1;
+						}
+						.text{
+							font-size: 26upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #222222;
+							line-height: 1;
+						}
+					}
+					.sn-box{
+						display: flex;
+						align-items: center;
+						.copy-btn{
+							width: 58upx;
+							height: 32upx;
+							line-height: 32upx;
+							text-align: center;
+							font-size: 22upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #222222;
+							background: #F5F5F5;
+							border-radius: 4upx;
+							margin-left: 24upx;
+						}
+					}
+				}
+			}
+		}
+		
+	}
+	.btn-box{
+		margin-top: 15upx;
+		box-sizing: border-box;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+		.btn{
+			width: 155upx;
+			height: 64upx;
+			line-height: 64upx;
+			font-size: 26upx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			text-align: center;
+			border-radius: 32upx;
+			margin-left: 15upx;
+			&:first-child{
+				margin-left: 0;
+			}
+			&.cancel{
+				border: 1px solid #DDDDDD;
+				color: #666666;
+			}
+			 
+		}
+	}
+	
+</style>

+ 417 - 0
pages_user/integral/refundOrderList.vue

@@ -0,0 +1,417 @@
+<template>
+	<view>
+		<view class="top-fixed">
+			<!-- tab切换 -->
+			<view class="pub-tab-box">
+				<view class="tab-inner">
+					<view 
+						v-for="(item,index) in statusList" 
+						:key="index"
+						:class="status == item.value?'item active':'item'"
+						@click="statusChange(item)"
+					>
+						<view class="text">
+							{{ item.name }}
+							<image v-show="status == item.value" class="tab-bg" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/tab_bg.png" mode=""></image>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="top-seat"></view>
+		<!-- 订单列表 -->
+		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
+			<view class="order-list">
+				<view v-for="(item,index) in dataList" :key="index" class="item"  >
+					<!-- 订单号,状态 -->
+					<view class="ordersn-box">
+						<view class="num">订单号:{{item.orderCode}}</view>
+						<view class="status-box">
+							<text  class="text success">{{$getDictLabelName("storeAfterSalesSalesStatus",item.salesStatus)}}</text>
+						</view>
+					</view>
+					<!-- 药品列表 -->
+					<view class="drug-list">
+						<view v-for="(subitem,j) in JSON.parse(item.itemJson)" :key="j">
+							<view class="drug-item">
+								<view class="img-box">
+									<image :src="subitem.imgUrl" mode="aspectFill"></image>
+								</view>
+								<view class="drug-info">
+									<view>
+										<view class="name-box ellipsis2">{{subitem.goodsName||''}}</view>
+										<!-- <view class="spec">规格:{{JSON.parse(subitem.jsonInfo).sku}}</view> -->
+									</view>
+									<view class="num-box">
+										<view class="price">
+											<text class="num" >{{subitem.integral}}</text>
+											<text class="unit">积分</text>
+											<text class="num" v-if="subitem.cash>0">+{{subitem.cash}}</text>
+											<text class="unit" v-if="subitem.cash>0">元</text>
+										</view>
+										<view class="amount">x{{subitem.num}}</view>
+									</view>
+								</view>
+							</view>
+						</view>
+						<!-- 实付金额、按钮 -->
+						<view class="bottom-box">
+							<view class="amount-paid">
+								<text class="label">退还:</text>
+								<view class="price-box">
+									<view class="num">{{item.refundIntegral || 0}}</view>
+									<view class="unit">积分</view>
+								</view>
+								<view class="unit">+</view>
+								<view class="price-box">
+									<view class="num">{{item.refundAmount || 0}}</view>
+									<view class="unit">元</view>
+								</view>
+							</view>
+							<view class="btn-box">
+								<view class="btn pay" @click="showDetail(item)">查看详情</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</mescroll-body>
+	</view>
+</template>
+
+<script>
+	import {getAfterSalesList} from '../api/integralAfterSales.js'
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	export default {
+		mixins: [MescrollMixin], 
+		data() {
+			return {
+				statusList: [
+					{name:'全部',value:"0"},
+					{name:'售后中',value:"1"},
+					{name:'已完成',value:"2"},
+				],
+				status: 0,
+				mescroll:null,
+				downOption: {
+					//下拉刷新
+					use: true,
+					auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
+				},
+				// 上拉加载的配置
+				upOption: {
+					onScroll:true,
+					use: true, // 是否启用上拉加载; 默认true
+					page: {
+						num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
+						size: 10 // 每页数据的数量,默认10
+					},
+					noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+					empty: {
+						icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
+						tip: '暂无数据'
+					}
+				},
+				// 列表数据
+				dataList: []
+			};
+		},
+		onLoad(option) {
+			var that=this;
+			uni.$on('refreshAfterSales', () => {
+				that.mescroll.resetUpScroll()
+			})
+		},
+		methods: {
+			// tab切换
+			statusChange(item) {
+				this.status = item.value
+				this.mescroll.resetUpScroll()
+			},
+			mescrollInit(mescroll) {
+				this.mescroll = mescroll;
+			},
+			/*下拉刷新的回调 */
+			downCallback(mescroll) {
+				mescroll.resetUpScroll()
+			},
+			upCallback(page) {
+				//联网加载数据
+				var that = this;
+				var data = {
+					status:this.status,
+					page: page.num,
+					pageSize: page.size
+				};
+				getAfterSalesList(data).then(res => {
+					if(res.code==200){
+						//设置列表数据
+						if (page.num == 1) {
+							that.dataList = res.data.list; 
+							
+						} else {
+							that.dataList = that.dataList.concat(res.data.list);
+							 
+						}
+						that.mescroll.endBySize(res.data.list.length, res.data.total);
+						
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: "请求失败",
+						});
+						that.dataList = null;
+						that.mescroll.endErr();
+					}
+				});
+			},
+			// 查看订单详情
+			showDetail(item) {
+				uni.navigateTo({
+					url: './refundOrderDetail?salesId=' + item.id
+				})
+			},
+			
+		}
+	}
+</script>
+
+<style lang="scss">
+	.top-fixed{
+		width: 100%;
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 10;
+	}
+	.pub-tab-box{
+		box-sizing: border-box;
+		width: 100%;
+		padding: 0 60upx;
+		background-color: #FFFFFF;
+		.tab-inner{
+			height: 88upx;
+			line-height: 88upx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			overflow-x: auto;
+		}
+		.item{
+			font-size: 28upx;
+			white-space: nowrap;
+			line-height: 1;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #666666;
+			margin-right: 60upx;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			&:last-child{
+				margin-right: 0;
+			}
+			&.active{
+				font-weight: bold;
+				color: #333333;
+			}
+			.text{
+				position: relative;
+				z-index: 1;
+			}
+			.tab-bg{
+				width: 72upx;
+				height: 28upx;
+				position: absolute;
+				top: 17upx;
+				left: 50%;
+				transform: translateX(-36upx);
+				z-index: -1;
+			}
+		}
+	}
+	.top-seat{
+		width: 100%;
+		height: 88upx;
+	}
+	.order-list{
+		padding: 20upx;
+		.item{
+			background: #FFFFFF;
+			border-radius: 16upx;
+			padding: 0 30upx;
+			margin-bottom: 20upx;
+			.ordersn-box{
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				padding: 34upx 0 20upx;
+				.num{
+					font-size: 26upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+					line-height: 1;
+				}
+				.status-box{
+					display: flex;
+					align-items: center;
+					.text{
+						font-size: 28upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						line-height: 1;
+						&.success{
+							color: #2583EB;
+						}
+						&.info{
+							color: #999999;
+						}
+					}
+				}
+			}
+			.drug-list{
+				.drug-item{
+					padding: 30upx 0;
+					border-bottom: 1px soli #F0F0F0;
+					display: flex;
+					align-items: center;
+					.img-box{
+						width: 160upx;
+						height: 160upx;
+						margin-right: 30upx;
+						flex-shrink: 0;
+						image{
+							width: 100%;
+							height: 100%;
+						}
+					}
+					.drug-info{
+						width: calc(100% - 190upx);
+						height: 160upx;
+						display: flex;
+						flex-direction: column;
+						justify-content: space-between;
+						.name-box{
+							font-size: 28upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #111111;
+							line-height: 40upx;
+							.tag{
+								display: inline-block;
+								padding: 0 6upx;
+								height: 30upx;
+								background: linear-gradient(90deg, #2583EB 0%, #2BC7A4 100%);
+								border-radius: 4upx;
+								margin-right: 10upx;
+								font-size: 22upx;
+								font-family: PingFang SC;
+								font-weight: bold;
+								color: #FFFFFF;
+								line-height: 30upx;
+								float: left;
+								margin-top: 7upx;
+							}
+						}
+						.spec{
+							font-size: 24upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #999999;
+							line-height: 1;
+							margin-top: 10upx;
+						}
+						.num-box{
+							display: flex;
+							align-items: center;
+							justify-content: space-between;
+							.price{
+								display: flex;
+								align-items: flex-end;
+								.unit{
+									font-size: 24upx;
+									font-family: PingFang SC;
+									font-weight: 500;
+									color: #111111;
+									line-height: 1.2;
+									margin-right: 4upx;
+								}
+								.num{
+									font-size: 32upx;
+									font-family: PingFang SC;
+									font-weight: 500;
+									color: #111111;
+									line-height: 1;
+								}
+							}
+							.amount{
+								font-size: 24upx;
+								font-family: PingFang SC;
+								font-weight: 500;
+								color: #999999;
+								line-height: 1;
+							}
+						}
+					}
+				}
+				.bottom-box{
+					height: 110upx;
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					.amount-paid{
+						display: flex;
+						align-items: center;
+						.label{
+							font-size: 24upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #999999;
+							line-height: 1;
+						}
+						.price-box{
+							display: flex;
+							align-items: flex-end;
+						}
+						.unit{
+							font-size: 24upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #FF6633;
+							line-height: 1.2;
+							margin-right: 4upx;
+						}
+						.num{
+							font-size: 32upx;
+							font-family: PingFang SC;
+							font-weight: bold;
+							color: #FF6633;
+							line-height: 1;
+						}
+					}
+					.btn-box{
+						box-sizing: border-box;
+						display: flex;
+						align-items: center;
+						.btn{
+							width: 220upx;
+							height: 64upx;
+							line-height: 64upx;
+							font-size: 26upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							text-align: center;
+							border-radius: 32upx;
+							&.pay{
+								background: #2583EB;
+								color: #FFFFFF;
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	
+</style>

+ 303 - 44
pages_user/integralGoodsDetails.vue

@@ -2,6 +2,12 @@
 	<view class="content">
 		<view class="cont-box">
 			<view class="goods-banner" @click="showImg()">
+				<view class="cartbox" @click.stop="goCart()">
+					<view class="box">
+						<u-badge type="error" max="99" :value="cartNum" bgColor="#FF5030"></u-badge>
+					</view>
+					<u-icon name="shopping-cart" color="#2583EB" size="68rpx"></u-icon>
+				</view>
 				<swiper
 					class="swiper" 
 					:indicator-dots="false" 
@@ -23,33 +29,77 @@
 			<view class="integral-box">
 				<view class="title">{{item.goodsName}}</view>
 				<view class="num-box">
-					<view class="price"  >{{item.integral}} 积分</view>
-					<view class="count">价值:{{item.otPrice.toFixed(2)}}元</view>
+					<view class="price-row">
+						<text class="integral-num">{{item.integral}}</text>
+						<text class="unit">积分</text>
+						<template v-if="item.cash>0">
+							<text class="plus">+</text>
+							<text class="integral-num">{{$formatNum(item.cash)}}</text>
+							<text class="unit">元</text>
+						</template>
+					</view>
+					<view class="count">价值:{{$formatNum(item.otPrice)}}元</view>
 				</view>
 				 
 			</view>
 			<view class="desc-box">
-				<view class="desc" v-html="item.descs" >
-					
-				</view>
+				<u-parse :content="item.descs" :tagStyle="tagStyle"></u-parse>
 			</view>
 		</view>
 		<view class="btn-foot">
 			<view class="p-price-box">
-				<view class="p-name">兑换积分: </view>
-				<view class="p-price"  >{{item.integral}}</view>
+				<!-- <view class="p-name">兑换积分: </view> -->
+				<view class="p-price">{{item.integral}}<text style="font-size: 20rpx;">积分</text></view>
+				<view class="p-price" v-if="item&&item.cash > 0">+{{$formatNum(item.cash)}}<text style="font-size: 20rpx;">元</text></view>
 			</view>
-			<view class="btn-box">
-				<view class="btn buy" @click="submit()"  >
+			<view class="btn-box" v-if="!isLogin|| Number(item.stock)>0&&integral>=item.integral">
+				<view class="btn add" @click="openPop">
+					加入购物车
+				</view>
+				<view class="btn buy" @click="submit()">
 					立即兑换
 				</view>
 			</view>
+			<view class="btn-box" v-else>
+				<view class="btn gary">
+					{{Number(item.stock)>0? Number(integral) >= Number(item.integral) ? '去兑换' : '积分不足':'已兑完'}}
+				</view>
+			</view>
 		</view>
+		<u-popup :show="show" mode="bottom" closeable @close="close">
+			<view class="popbox">
+				<view class="x-f">
+					<image class="popbox-img" :src="item.imgUrl" mode="aspectFill"></image>
+					<view class="info-text">
+						<view class="price">
+							<text class="unit">¥</text>
+							<text class="num">{{$formatNum(item.cash)}}</text>
+							<text class="oldprice"> ¥{{$formatNum(item.otPrice)}}</text>
+						</view>
+						<view class="text es-mt-16">所需积分:{{item.integral}}</view>
+						<view class="desc-box es-mt-16">
+							 <text class="text">库存:{{item.stock>0?item.stock:'售罄'}} </text>
+						</view>
+					</view>
+				</view>
+				<!-- 数量 -->
+				<view class="price-num x-bc" style="margin-top: 30rpx;">
+					<view class="label">数量</view>
+					<view class="num-box">
+						<u-number-box v-model="num" integer :step="1" :min="1" :max="100000"></u-number-box>
+					</view>
+				</view>
+				<view class="es-max-btn x-c" @click="addCart">
+					加入购物车
+				</view>
+			</view>
+		</u-popup>
 	</view> 
 </template>
 
 <script>
-	import {getIntegralGoodsById,createOrder} from '@/api/integral.js'
+	import { getUserInfo } from '@/api/user'
+	import {getIntegralGoodsById,createOrder,addOrUpdateCart,getCartCount,compute} from './api/integral.js'
 	export default {
 		data() {
 			return {
@@ -57,19 +107,108 @@
 				activeImg: 1,
 				goodsId:null,
 				item:{},
+				show: false,
+				num: 1,
+				cartNum: 0,
+				integral: 0,
+				isLogin: false,
+				tagStyle: {
+					img: 'display: block;'
+				}
 			};
 		},
 		onLoad(option) {
 			this.goodsId=option.goodsId;
-			 
 		},
 		onShow() {
 			this.getIntegralGoodsById();
+			this.$isLogin().then(
+				res => {
+					this.isLogin = res
+					if(res){
+						this.getcartNum()
+						this.getUserInfo();
+					}
+				}
+			);
 		},
 		methods:{
+			goCart() {
+				uni.navigateTo({
+					url: '/pages_user/cart'
+				})
+			},
+			getUserInfo() {
+				getUserInfo().then(
+					res => {
+						if (res.code == 200) {
+							if (res.user != null) {
+								this.integral = res.user.integral;
+							}
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+			getcartNum() {
+				getCartCount().then(res=>{
+					if(res.code == 200) {
+						this.cartNum = res.data || 0
+					}
+				})
+			},
+			close() {
+				this.show = false
+			},
+			openPop() {
+				this.$isLogin().then(
+					res => {
+						this.isLogin = res
+						if(res){
+							this.num = 1
+							this.show = true
+						} else{
+							uni.navigateTo({
+								url: '/pages/auth/login'
+							})
+						}
+					}
+				);
+			},
+			addCart() {
+				uni.showLoading({
+					title: '处理中'
+				})
+				addOrUpdateCart({
+					cartNum: this.num,
+					goodsId: this.goodsId,
+					isCart: 0
+				}).then(res=>{
+					uni.hideLoading()
+					if(res.code==200) {
+						this.show = false
+						uni.showToast({
+							title: '加入购物车成功',
+							icon: 'none'
+						})
+						this.getcartNum()
+					} else {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none'
+						})
+					}
+				})
+			},
 			submit(){
 				this.$isLogin().then(
 					res => {
+						this.isLogin = res
 						if(res){
 							uni.navigateTo({
 								url: "./integralOrderPay?goodsId="+this.goodsId
@@ -105,7 +244,6 @@
 							else{
 								this.activeImg=0;
 							}
-							console.log(this.imgs)
 						}else{
 							uni.showToast({
 								icon:'none',
@@ -121,8 +259,24 @@
 </script>
 
 <style lang="scss">
-	page{
-		height: 100%;
+	.cartbox {
+		position: fixed;
+		bottom: 180rpx;
+		right: 20rpx;
+		z-index: 99;
+		background-color: #fff;
+		box-shadow: 0 2px 4px rgba(150, 150, 150, 0.6);
+		padding: 10rpx;
+		border-radius: 50%;
+		.box {
+			position: absolute;
+			top: -10rpx;
+			right: 0;
+			z-index: 99;
+		}
+	}
+	.es-mt-16 {
+		margin-top: 16rpx;
 	}
 	.content{
 		height: 100%;
@@ -142,7 +296,7 @@
 				 
 				.title{
 					font-weight: bold;
-					font-size: 34upx;
+					font-size: 34rpx;
 					font-family: PingFang SC;
 					color: #111;
 				}
@@ -155,7 +309,7 @@
 						background-color: #eee;
 						border-radius: 30rpx;
 						padding: 5rpx 15rpx;
-						font-size: 26upx;
+						font-size: 26rpx;
 						font-family: PingFang SC;
 						color: #2583EB;
 					}
@@ -164,7 +318,7 @@
 						background-color: #eee;
 						border-radius: 30rpx;
 						padding: 5rpx 15rpx;
-						font-size: 26upx;
+						font-size: 26rpx;
 						font-family: PingFang SC;
 						color: #2583EB;
 					}
@@ -174,20 +328,25 @@
 					margin-top: 15rpx;
 					flex: 1;
 					display: flex;
-					align-items: flex-end;
+					align-items: center;
 					justify-content: space-between;
 					width: 100%;
 					.price{
 						padding: 5rpx 10rpx;
 						background-color: #2583EB;
 						border-radius: 30rpx;
-						font-size: 20upx;
+						font-size: 20rpx;
 						font-family: PingFang SC;
 						color: #ffffff;
 					}
-					
+					.price-val {
+						font-weight: bold;
+						font-size: 28rpx;
+						font-family: PingFang SC;
+						color: #2583EB;
+					}
 					.count{
-						font-size: 24upx;
+						font-size: 24rpx;
 						font-family: PingFang SC;
 						color: #333333;
 					}
@@ -206,7 +365,7 @@
 					align-items: center;
 					justify-content: flex-start;
 					.title{
-						font-size: 32upx;
+						font-size: 32rpx;
 						font-family: PingFang SC;
 						font-weight: bold;
 						color: #111111;
@@ -222,7 +381,7 @@
 				}
 				.desc{
 					margin-top: 15rpx;
-					font-size: 28upx;
+					font-size: 28rpx;
 					font-family: PingFang SC;
 					color: #9a9a9c;
 				}
@@ -234,9 +393,9 @@
 	.btn-foot{
 		box-sizing: border-box;
 		width: 100%;
-		height: 121upx;
+		height: 121rpx;
 		background: #FFFFFF;
-		padding: 0 32upx 0 28upx;
+		padding: 0 32rpx 0 28rpx;
 		display: flex;
 		align-items: center;
 		justify-content: space-between;
@@ -245,10 +404,8 @@
 		bottom: 0;
 		z-index: 99;
 		.p-price-box{
-			display: flex;
-			align-items: center;
 			.p-name{
-				font-size: 28upx;
+				font-size: 28rpx;
 				font-family: PingFang SC;
 				font-weight: 500;
 				color: #666666;
@@ -256,7 +413,7 @@
 			.p-price{
 				margin-left: 10rpx;
 				color: #FF6633;
-				font-size: 32upx;
+				font-size: 32rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
 				
@@ -267,13 +424,13 @@
 			display: flex;
 			align-items: center;
 			.btn{
-				width: 200upx;
-				height: 88upx;
-				line-height: 88upx;
+				width: 200rpx;
+				height: 88rpx;
+				line-height: 88rpx;
 				text-align: center;
-				border-radius: 44upx;
-				margin-left: 20upx;
-				font-size: 30upx;
+				border-radius: 44rpx;
+				margin-left: 20rpx;
+				font-size: 30rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
 				color: #FFFFFF;
@@ -284,14 +441,22 @@
 				&.buy{
 					background: #2583EB;
 				}
-				 
+				&.add {
+					color: #2583EB !important;
+					border: 1rpx solid #2583EB;
+				}  
+				&.gary{
+					color: #555 !important;
+					background-color: #fff !important;
+					border: 1rpx solid #aaa;
+				}
 			}
 			
 		}
 	}
 	 
 	.goods-banner{
-		height: 756upx;
+		height: 756rpx;
 		background-color: #FFFFFF;
 		position: relative;
 		.swiper-item{
@@ -304,20 +469,114 @@
 			height: 100%;
 		}
 		.num-box{
-			width: 80upx;
-			height: 44upx;
-			line-height: 44upx;
+			width: 80rpx;
+			height: 44rpx;
+			line-height: 44rpx;
 			text-align: center;
-			font-size: 24upx;
+			font-size: 24rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
 			color: #FFFFFF;
 			background: rgba(0, 0, 0, .3);
-			border-radius: 22upx;
+			border-radius: 22rpx;
 			position: absolute;
-			right: 30upx;
-			bottom: 30upx;
+			right: 30rpx;
+			bottom: 30rpx;
 			z-index: 10;
 		}
 	}
+	.popbox {
+		padding: 40rpx 32rpx;
+		&-img {
+			width: 200rpx;
+			height: 200rpx;
+			border-radius: 20rpx;
+			margin-right: 24rpx;
+		}
+		.oldprice {
+			font-size: 28rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #999999;
+			margin-top: 27rpx;
+			line-height: 1;
+			text-decoration: line-through;
+			margin-left: 24rpx;
+		}
+		.info-text{
+			height: 200rpx;
+			.price{
+				display: flex;
+				align-items: flex-end;
+				.unit{
+					font-size: 32rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #FF5030;
+					line-height: 1.2;
+					margin-right: 10rpx;
+				}
+				.num{
+					font-size: 50rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #FF5030;
+					line-height: 1;
+				}
+			}
+			.text {
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 400;
+				color: #FF5030;
+			}
+			.desc-box{
+				display: flex;
+				flex-direction: column;
+				padding-bottom: 9rpx;
+				.text{
+					font-size: 28rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+					margin-top: 27rpx;
+					line-height: 1;
+					&:first-child{
+						margin-top: 0;
+					}
+				}
+			}
+		}
+	}
+	.es-max-btn{
+		width: 100%;
+		background-color: #2583EB;
+		border-radius: 60rpx;
+		margin-top: 50rpx;
+		color: #fff;
+		padding: 20rpx 0;
+		box-sizing: border-box;
+	}
+	.price-row {
+		display: flex;
+		align-items: baseline;
+		color: #FF5030;
+	
+		.integral-num {
+			flex-shrink: 0;
+			font-family: Roboto, Roboto;
+			font-weight: 500;
+			font-size: 36rpx;
+			color: #FF5030;
+			margin-right: 4rpx;
+		}
+	
+		.unit {
+			flex-shrink: 0;
+			font-family: PingFang SC, PingFang SC;
+			font-weight: 400;
+			font-size: 22rpx;
+			color: #FF5030;
+		}
+	}
 </style>

+ 301 - 156
pages_user/integralGoodsList.vue

@@ -2,64 +2,110 @@
 	<view class="content">
 		<view class="cont-box">
 			<view class="top-box">
-				<view class="my-integral">
-					<view class="left">
-						<view class="label">我的积分</view>
-						<view class="integral">{{integral}}</view>
+				<view class="status_bar" :style="{height: statusBarHeight}"></view>
+				<view class="page-titlebox">
+					<u-icon name="arrow-left" color="#222" size="24" @click="navback()"></u-icon>
+					<view class="page-title">积分商城</view>
+					<view></view>
+				</view>
+				<view class="my-integral-card">
+					<view class="card-top" v-if="isLogin">
+						<view class="left-info">
+							<view class="label-box">
+								<image class="icon-coin" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/fs/20260721/f3be3672e248441384cda2bbbf932200.png" mode=""></image>
+								<text class="label">我的积分</text>
+							</view>
+							<view class="integral-value">{{integral}}</view>
+						</view>
+						<view class="get-btn" @click="navTo('/pages_user/integral')">获取积分</view>
 					</view>
-					<view class="btn-box">
-						<view class="btn" @click="loginNavTo('/pages_user/integralLogsList')">获得记录</view>
-						<view class="btn" @click="loginNavTo('/pages_user/integralOrderList')">兑换记录</view>
+					<view class="card-top unlogin-top" v-else @click="loginNavTo()">
+						<view class="left-info">
+							<view class="label-box">
+								<image class="icon-coin" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/fs/20260721/f3be3672e248441384cda2bbbf932200.png" mode=""></image>
+								<text class="label">我的积分</text>
+							</view>
+							<view class="login-tip">登录后查看积分</view>
+						</view>
+						<view class="login-btn">去登录</view>
 					</view>
-				</view>
-				<view class="search-cont">
-					<view class="inner">
-						<image class="icon-search" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/icon_search.png" mode=""></image>
-						<input type="text" v-model="keyword" placeholder="搜索商品" confirm-type="search" @confirm="doSearch" placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
+					<view class="card-bottom">
+						<view class="btn-item" @click="loginNavTo('/pages_user/integralLogsList')">
+							<text style="margin-right: 8rpx;">积分明细</text> <u-icon name="arrow-right" size="14" color="#fff"></u-icon>
+						</view>
+						<view class="btn-item" @click="loginNavTo('/pages_user/integralOrderList')">
+							<text style="margin-right: 8rpx;">积分订单</text> <u-icon name="arrow-right" size="14" color="#fff"></u-icon>
+						</view>
+						<view class="btn-item" @click="loginNavTo('/pages_user/integral/refundOrderList')">
+							<text style="margin-right: 8rpx;">售后订单</text> <u-icon name="arrow-right" size="14" color="#fff"></u-icon>
+						</view>
 					</view>
 				</view>
-				<view class="tabs" v-if="tabs.length>0">
+				
+				<view class="tabs-section" v-if="tabs.length>0">
 					<u-tabs
 					 :current="tabIndex"
 					 :scrollable="true"
 					 :list="tabs"  
 					 lineColor="#2583EB"
+					 :activeStyle="{
+						color: '#2583EB',
+						fontWeight: 'bold',
+						transform: 'scale(1.05)'
+					 }"
+					 :inactiveStyle="{
+						color: '#666',
+						transform: 'scale(1)'
+					 }"
 					@change="tabChange">
 					</u-tabs>
 				</view>
 			</view>
 			<mescroll-body :top="top+'px'" bottom="0"  ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
-			<view class="integral-box"  >
-				<view class="item"  @click="navTo('/pages_user/integralGoodsDetails?goodsId='+item.goodsId)" v-for="(item,index) in dataList">
+			<view class="integral-box">
+				<view class="item" @click="navTo('/pages_user/integralGoodsDetails?goodsId='+item.goodsId)" v-for="(item,index) in dataList" :key="index">
 					<view class="top">
-						<image :src="item.imgUrl"></image>
+						<image :src="item.imgUrl" mode="aspectFill"></image>
 					</view>
 					<view class="bottom">
-						<view class="title ellipsis2">
-							{{item.goodsName}}
+						<view class="title ellipsis2">{{item.goodsName}}</view>
+						<view class="ot-price">价值¥{{$formatNum(item.otPrice)}}</view>
+						<view class="price-row">
+							<text class="integral-num">{{item.integral}}</text>
+							<text class="unit">积分</text>
+							<template v-if="item&&item.cash>0">
+								<text class="plus">+</text>
+								<text class="integral-num">{{$formatNum(item.cash)}}</text>
+								<text class="unit">元</text>
+							</template>
 						</view>
-						<view class="price-box">
-							<view class="price">{{item.integral}}积分</view>
-							<view class="count">价值:{{item.otPrice.toFixed(2)}}元</view>
+						<view class="btn-action" :class="{ disabled: isLogin && integral < item.integral }">
+							{{ !isLogin || integral >= item.integral ? '去兑换' : '积分不足' }}
 						</view>
 					</view>
 				</view>
 			</view>
 			</mescroll-body>
 		</view>
-		
+		<view class="cartbox" @click.stop="goCart()">
+			<view class="box">
+				<u-badge type="error" max="99" :value="cartNum" bgColor="#FF5030"></u-badge>
+			</view>
+			<u-icon name="shopping-cart" color="#2583EB" size="68rpx"></u-icon>
+		</view>
 	</view>
 </template>
 
 <script>
  import {getDictByKey} from '@/api/common.js'
  import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- import {getIntegralGoodsList} from '@/api/integral.js'
+ import {getIntegralGoodsList,getCartCount} from './api/integral.js'
  import {getUserInfo} from '@/api/user'
  export default {
 	mixins: [MescrollMixin], 
  	data() {
  		return {
+			statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
 			integral:0,
 			type: null,
 			typeOptions:[],
@@ -86,15 +132,21 @@
 			},
 			dataList: [],
 			keyword:"",
-			top: uni.upx2px(432)
+			top: 0,
+			cartNum: 0,
+			isLogin: false
  		}
  	},
 	onLoad() {
 		this.getDictByKey("sys_integral_goods_type");
+	},
+	onShow() {
 		this.$isLogin().then(
 			res => {
+				this.isLogin = res
 				if(res){
 					this.getUserInfo();
+					this.getcartNum()
 				}
 			}
 		);
@@ -103,13 +155,33 @@
 		this.getTop()
 	},
  	methods: {
+		goCart() {
+			uni.navigateTo({
+				url: '/pages_user/cart'
+			})
+		},
+		navback() {
+			const pages = getCurrentPages(); // 获取当前页面栈
+			if (pages.length > 1) {
+			  uni.navigateBack()
+			} else {
+			   uni.reLaunch({ url: '/pages/index/index' });
+			}
+		},
+		getcartNum() {
+			getCartCount().then(res=>{
+				if(res.code == 200) {
+					this.cartNum = res.data || 0
+				}
+			})
+		},
 		getTop() {
 			const query = uni.createSelectorQuery().in(this);
 			query
 			  .select(".top-box")
 			  .boundingClientRect((data) => {
 			    if(data) {
-					this.top = data.height + uni.upx2px(88)
+					this.top = data.height + 44 + uni.upx2px(40)
 				}
 			  })
 			  .exec();
@@ -168,7 +240,6 @@
 						if(this.tabs.length>0){
 							this.tabIndex=0
 						}
-						
 					}
 				},
 				err => {
@@ -234,156 +305,230 @@
 
 
 <style scoped lang="scss">
-page{
+page {
 	height: 100%;
-	background-color: #f5f5f5;
+	background-color: #f8f8f8;
 }
-.search-cont{
-	height: 88upx;
+.cartbox {
+	position: fixed;
+	bottom: 180rpx;
+	right: 20rpx;
+	z-index: 99;
+	background-color: #fff;
+	box-shadow: 0 2px 4px rgba(150, 150, 150, 0.6);
+	padding: 10rpx;
+	border-radius: 50%;
+	.box {
+		position: absolute;
+		top: -10rpx;
+		right: 0;
+		z-index: 99;
+	}
+}
+.content {
+	height: 100%;
+}
+
+.top-box {
+	z-index: 999;
+	padding: 0 30rpx;
 	width: 100%;
-	display: flex;
-	align-items: flex-end;
-	.inner{
-		box-sizing: border-box;
-		width: 100%;
-		height: 72upx;
-		background: #fff;
-		border-radius: 36upx;
+	position: fixed;
+	top: 0rpx;
+	left: 0rpx;
+	background: linear-gradient(180deg, #C1DBFD 0%, #F8F8F8 100%);
+	.page-titlebox {
+		height: 88rpx;
+		margin-bottom: 20rpx;
 		display: flex;
 		align-items: center;
-		padding: 0 30upx;
-		.icon-search{
-			width: 28upx;
-			height: 28upx;
-			margin-right: 20upx;
-		}
-		input{
-			height: 60upx;
-			line-height: 60upx;
-			flex: 1;
-		}
+		justify-content: space-between;
 	}
-}
-.content{
-	height: 100%;
-	.cont-box{
-		.top-box{
-			z-index: 999;
-			padding: 30rpx 30rpx 0 30rpx;
-			width: 100%;
-			position: fixed;
-			top: 0rpx;
-			left: 0rpx;
-			background-color: #f5f5f5;
-			.my-integral{
-				height: 200rpx;
-				box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
-				background: linear-gradient(#2583EB, #2EDAD4);
-				border-radius: 30rpx;
-				display: flex;
-				align-items: flex-start;
-				justify-content: space-between;
-				padding: 30rpx;
-				.left{
-					.label{
-						font-size: 28upx;
-						font-family: PingFang SC;
-						color: #fff;
+	.page-title {
+		text-align: center;
+		font-size: 34rpx;
+		font-weight: bold;
+		color: #333;
+	}
+
+	.my-integral-card {
+		background: #2583EB;
+		border-radius: 20rpx;
+		padding: 30rpx;
+		color: #fff;
+		box-shadow: 0 8rpx 20rpx rgba(37, 131, 235, 0.2);
+
+		.card-top {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			margin-bottom: 30rpx;
+
+			.left-info {
+				.label-box {
+					display: flex;
+					align-items: center;
+					margin-bottom: 10rpx;
+
+					.icon-coin {
+						width: 36rpx;
+						height: 36rpx;
+						margin-right: 10rpx;
 					}
-					.integral{
-						margin-top: 30rpx;
-						font-weight: bold;
-						font-size: 40upx;
-						font-family: PingFang SC;
-						color: #fff;
+
+					.label {
+						font-size: 28rpx;
+						opacity: 0.9;
 					}
 				}
-				.btn-box{
-					display: flex;
-					flex-direction: column;
-					align-items: flex-start;
-					justify-content: flex-start;
-					.btn{
-						margin-bottom: 30rpx;
-						background-color: #fff;
-						border-radius: 30rpx;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-						padding: 10rpx 15rpx;
-						font-size: 20upx;
-						font-family: PingFang SC;
-						color: #2583EB;
-					}
+
+				.integral-value {
+					font-size: 60rpx;
+					font-weight: bold;
+					font-family: DIN;
 				}
 			}
-			.tabs{
-				height: 88rpx;
+
+			.get-btn {
+				background: #fff;
+				color: #2583EB;
+				padding: 12rpx 30rpx;
+				border-radius: 40rpx;
+				font-size: 28rpx;
+				font-weight: 500;
+			}
+		}
+
+		.unlogin-top {
+			.login-tip {
+				font-size: 34rpx;
+				font-weight: bold;
+				margin-top: 10rpx;
+			}
+			.login-btn {
+				background: #fff;
+				color: #2583EB;
+				padding: 12rpx 36rpx;
+				border-radius: 40rpx;
+				font-size: 28rpx;
+				font-weight: bold;
 			}
 		}
-		.integral-box{
-			padding: 30rpx;
+
+		.card-bottom {
 			display: flex;
-			align-items: flex-start;
-			justify-content: flex-start;
-			flex-wrap: wrap;
-			.item{
-				box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
-				background-color: #fff;
-				width: calc(50% - 20rpx);
-				border-radius: 15rpx;
-				margin: 10rpx;
+			align-items: center;
+			background: rgba(255, 255, 255, 0.2);
+			margin: 0 -30rpx -30rpx -30rpx;
+			padding: 24rpx 0;
+			border-radius: 0 0 20rpx 20rpx;
+
+			.btn-item {
+				flex: 1;
 				display: flex;
-				flex-direction: column;
-				align-items: flex-start;
-				justify-content: flex-start;
-				&:last-child{
+				align-items: center;
+				justify-content: center;
+				font-size: 26rpx;
+				border-right: 1rpx solid rgba(255, 255, 255, 0.3);
+				u-icon {
+					margin-left: 6rpx;
 				}
-				.top{
-					width:100%;
-					height:300rpx;
-					image{
-						border-radius: 15rpx 15rpx 0rpx 0rpx;
-						width:100%;
-						height:300rpx;
-					}
-					
+			}
+		}
+	}
+
+	.tabs-section {
+		margin-top: 20rpx;
+		/deep/ .u-tabs__wrapper__nav__item {
+			padding: 0 30rpx !important;
+		}
+	}
+}
+
+.integral-box {
+	padding: 20rpx;
+	display: flex;
+	flex-wrap: wrap;
+	
+	.item {
+		width: calc(50% - 20rpx);
+		margin: 10rpx;
+		background: #fff;
+		border-radius: 16rpx;
+		overflow: hidden;
+		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
+
+		.top {
+			width: 100%;
+			height: 340rpx;
+			image {
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+		.bottom {
+			padding: 20rpx;
+
+			.title {
+				font-family: PingFang SC, PingFang SC;
+				font-weight: 500;
+				font-size: 30rpx;
+				color: #222222;
+				line-height: 1.4;
+				height: 80rpx;
+				margin-bottom: 10rpx;
+			}
+
+			.ot-price {
+				font-family: PingFang SC, PingFang SC;
+				font-weight: 400;
+				font-size: 24rpx;
+				color: #999999;
+				margin-bottom: 10rpx;
+				text-decoration-line: line-through;
+			}
+
+			.price-row {
+				display: flex;
+				align-items: baseline;
+				margin-bottom: 16rpx;
+				color: #FF5030;
+
+				.integral-num {
+					flex-shrink: 0;
+					font-family: Roboto, Roboto;
+					font-weight: 500;
+					font-size: 36rpx;
+					color: #FF5030;
+					margin-right: 4rpx;
 				}
-				.bottom{
-					width: 100%;
-					padding: 15rpx;
-					.title{
-						font-weight: bold;
-						font-size: 28upx;
-						font-family: PingFang SC;
-						color: #111111;
-					}
-					.price-box{
-						margin-top: 10rpx;
-						display: flex;
-						align-items: center;
-						justify-content: space-between;
-						width: 100%;
-						.price{
-							padding: 5rpx 10rpx;
-							background-color: #2583EB;
-							border-radius: 30rpx;
-							font-size: 20upx;
-							font-family: PingFang SC;
-							color: #ffffff;
-						}
-						.count{
-							font-size: 24upx;
-							font-family: PingFang SC;
-							color: #333333;
-						}
-						
-					}
+
+				.unit {
+					flex-shrink: 0;
+					font-family: PingFang SC, PingFang SC;
+					font-weight: 400;
+					font-size: 22rpx;
+					color: #FF5030;
+				}
+			}
+
+			.btn-action {
+				width: 100%;
+				height: 56rpx;
+				line-height: 56rpx;
+				text-align: center;
+				background: linear-gradient( 90deg, #2583EB 0%, #37A1FE 100%);
+				color: #fff;
+				border-radius: 32rpx;
+				font-size: 26rpx;
+
+				&.disabled {
+					background: #ECECEC;
+					color: #757575;
 				}
 			}
 		}
 	}
 }
- 
-
 </style>

+ 2 - 2
pages_user/integralLogsList.vue

@@ -21,7 +21,7 @@
 
 <script>
 	import {getDictByKey} from '@/api/common.js'
-	import {getUserIntegralLogsList} from '@/api/integral.js'
+	import {getUserIntegralLogsList} from './api/integral.js'
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	export default {
 		mixins: [MescrollMixin], // 使用mixin
@@ -42,7 +42,7 @@
 					noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
 					textNoMore:"已经到底了",
 					empty: {
-						icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
+						icon:'https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/empty_icon.png',
 						tip: '暂无数据'
 					}
 				},

+ 299 - 0
pages_user/integralOrderDelivery.vue

@@ -0,0 +1,299 @@
+<template>
+	<view>
+		<view class="top-cont">
+			<!-- 背景图片 -->
+			<view class="bg"></view>
+			<view class="top-inner">			
+				<!-- 运单号 -->
+				<view class="waybill-number">
+					<view class="inner">
+						<view class="num-box">
+							<text class="text">运单号</text>
+							<text class="text">{{deliverySn}}</text>
+							<view class="copy" @click="copyOrderSn(deliverySn)">复制</view>
+						</view>
+						<view class="kf-box">
+							<text class="text">{{express}}</text>
+							<!-- <text class="text">客服电话:95311</text> -->
+						</view>
+					</view>
+				</view>
+				<view class="content">
+					<!-- 物流信息 -->
+					<view class="refund-steps" v-if="expressList&&expressList.length>0">
+						<view v-for="(item,index) in expressList" :key="index" class="steps">
+							<view class="title">
+								<!-- <text v-if="index == 0" class="text black-text">已签收</text> -->
+								<!-- <text  class="text gray-bold">运输中</text> -->
+								<!-- 左侧灰色圆点 -->
+								<view class="dot"></view>
+								<!-- 对号 -->
+								<image  class="img" src="/static/images/complete.png" mode=""></image>
+								<!-- 运输中图标 -->
+								<image  class="img" src="/static/images/car40.png" mode=""></image>
+							</view>
+							<view  class="desc-text">
+								{{item.AcceptStation}}
+							</view>
+							 
+							<view class="time">{{item.AcceptTime}}</view>
+						</view>
+					</view>
+					<view class="refund-steps"  v-else>{{Reason}}</view>
+				</view>
+			</view>
+			
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	import {getExpress} from './api/integral.js'
+	export default {
+		data() {
+			return {
+				orderId:null,
+				deliverySn:null,
+				express:{},
+				expressList:[],
+				Reason: ''
+			};
+		},
+		onLoad(option) {
+			this.orderId=option.orderId;
+			this.getExpress();
+		},
+		methods: {
+			getExpress(){
+				getExpress({orderId:this.orderId}).then(res => {
+					if(res.code==200){
+						this.express=res.deliveryName;
+						this.expressList=res.data.Traces;
+						this.deliverySn=res.data.LogisticCode
+						this.Reason = res.data.Reason
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: "请求失败",
+						});
+						 
+					}
+				});
+			},
+			// 返回上一页
+			back() {
+				uni.navigateBack()
+			},
+			// 复制运单号
+			copyOrderSn(text) {
+				// 复制方法
+				uni.setClipboardData({
+					data:text,
+					success:()=>{
+						uni.showToast({
+							title:'内容已成功复制到剪切板',
+							icon:'none'
+						})
+					}
+				});
+			},
+			// 拨打电话
+			callPhone(phone) {
+				uni.makePhoneCall({
+					phoneNumber: phone
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.top-cont{
+		width: 100%;
+		height: 336upx;
+		position: relative;
+		.bg{
+			width: 100%;
+			height: 350upx;
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: 1;
+			background-color: #2583EB;
+			border-radius: 0rpx 0rpx 100rpx 100rpx;
+		}
+		.top-inner{
+			width: 100%;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: 2;
+			.back-box{
+				height: 88upx;
+				padding-left: 22upx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				padding: 0 20upx;
+				image{
+					width: 40upx;
+					height: 40upx;
+				}
+				.title{
+					font-size: 36upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #FFFFFF;
+				}
+			}
+			.waybill-number{
+				padding: 0 20upx;
+				margin-top: 66upx;
+				.inner{
+					box-sizing: border-box;
+					height: 150upx;
+					background: #FFFFFF;
+					border-radius: 16upx;
+					padding: 40upx 30upx;
+					display: flex;
+					flex-direction: column;
+					justify-content: space-between;
+					.num-box{
+						display: flex;
+						align-items: center;
+						.text{
+							font-size: 28upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #111111;
+							line-height: 1;
+							margin-right: 30upx;
+							&:last-child{
+								margin-right: 20upx;
+							}
+						}
+						.copy{
+							width: 58upx;
+							height: 32upx;
+							line-height: 32upx;
+							text-align: center;
+							font-size: 22upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #222222;
+							background: #F5F5F5;
+							border-radius: 4upx;
+						}
+					}
+					.kf-box{
+						display: flex;
+						align-items: center;
+						.text{
+							font-size: 26upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #999999;
+							line-height: 1;
+							margin-right: 20upx;
+						}
+					}
+				}
+			}
+			
+		}
+	}
+	.content{
+		margin: 20rpx 0rpx;
+		padding: 0 20upx;
+		.refund-steps{
+			background: #FFFFFF;
+			border-radius: 16upx;
+			padding: 40upx 44upx;
+			.steps{
+				padding-left: 40upx;
+				padding-bottom: 56upx;
+				position: relative;
+				&::after{
+					content: "";
+					width: 4upx;
+					height: 100%;
+					background: #F1F1F1;
+					position: absolute;
+					left: 0;
+					top: 20upx;
+				}
+				&:last-child{
+					padding-bottom: 0;
+					&::after{
+						display: none;
+					}
+				}
+				.title{
+					position: relative;
+					.text{
+						font-size: 30upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #666666;
+						line-height: 38upx;
+						&.black-text{
+							color: #111111;
+							font-weight: bold;
+						}
+						&.gray-bold{
+							font-weight: bold;
+							color: #666666;
+						}
+					}
+					.dot{
+						width: 16upx;
+						height: 16upx;
+						background: #EBEBEB;
+						border-radius: 50%;
+						position: absolute;
+						left: -46upx;
+						top: 11upx;
+						z-index: 10;
+						&.active{
+							background-color: #2583EB;
+						}
+					}
+					.img{
+						width: 40upx;
+						height: 40upx;
+						position: absolute;
+						left: -57upx;
+						top: 2upx;
+						z-index: 10;
+					}
+				}
+				.desc-text{
+					font-size: 28upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #666666;
+					line-height: 1.6;
+					margin-top: 10upx;
+					.phone{
+						font-size: 28upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #2583EB;
+						line-height: 1.6;
+					}
+				}
+				.time{
+					font-size: 24upx;
+					font-family: Gilroy;
+					font-weight: 500;
+					color: #999999;
+					margin-top: 10upx;
+				}
+			}
+		}
+		
+	}
+	
+</style>

+ 107 - 26
pages_user/integralOrderDetails.vue

@@ -5,11 +5,20 @@
 			<view class="inner">			
 				<!-- 订单状态 -->
 				<view class="order-status">
-				 
+					<!-- 待付款 -->
+					<view v-if="order.status == 4" class="inner">
+						<view class="img-box">
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/pag96.png" mode=""></image>
+						</view>
+						<view class="status-box">
+							<text class="status">待付款</text>
+							<text class="desc">请尽快完成支付</text>
+						</view>
+					</view>
 					<!-- 待发货 -->
 					<view v-if="order.status == 1" class="inner">
 						<view class="img-box">
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/520e24fba47441b3b0f73b5250bb0b57.png" mode=""></image>
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/pag96.png" mode=""></image>
 						</view>
 						<view class="status-box">
 							<text class="status">待发货</text>
@@ -19,7 +28,7 @@
 					<!-- 已发货、待收货 -->
 					<view v-if="order.status == 2" class="inner">
 						<view class="img-box">
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/1e6ba423ff7e4537bef87a022d530015.png" mode=""></image>
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/receipt.png" mode=""></image>
 						</view>
 						<view class="status-box">
 							<text class="status">待收货</text>
@@ -29,7 +38,7 @@
 					<!-- 已完成 -->
 					<view v-if="order.status == 3" class="inner">
 						<view class="img-box">
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/0712ba14f3a648afa69c9912fcbf9b61.png" mode=""></image>
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/finish96.png" mode=""></image>
 						</view>
 						<view class="status-box">
 							<text class="status">已完成</text>
@@ -37,21 +46,38 @@
 						</view>
 					</view>
 					<!--交易取消 -->
-					<view v-if="order.status == -1" class="inner">
+					<view v-if="order.status == 5" class="inner">
 						<view class="img-box">
-							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/02f95bd03e854a9c8076aef1e6c05e74.png" mode=""></image>
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/close_trade.png" mode=""></image>
 						</view>
 						<view class="status-box">
 							<text class="status">交易关闭</text>
 							<text class="desc">订单已取消</text>
 						</view>
 					</view>
-					 
+					<view v-if="order.status == -1" class="inner">
+						<view class="img-box">
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/close_trade.png" mode=""></image>
+						</view>
+						<view class="status-box">
+							<text class="status">申请售后</text>
+							<text class="desc">请等待客服审核</text>
+						</view>
+					</view>
+					<view v-if="order.status == -2" class="inner">
+						<view class="img-box">
+							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/close_trade.png" mode=""></image>
+						</view>
+						<view class="status-box">
+							<text class="status">退款成功</text>
+							<text class="desc">已成功退款</text>
+						</view>
+					</view> 
 				</view>
 				<!-- 下单人信息 -->
 				<view class="order-placer" v-if="order.userName!=null">
 					<view class="inner">
-						<image class="location" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/location.png" mode=""></image>
+						<image class="location" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/images/location.png" mode=""></image>
 						<view class="info">
 							<view class="name-phone">
 								<text class="text">{{order.userName}}</text>
@@ -65,9 +91,9 @@
 				</view>
 				<view class="content">
 					<view class="goods-list">
-						<view   class="item"  >
+						<view   class="item" v-for="(item,index) in list" :key="index" >
 							<view class="img-box">
-								<image :src="item.imgUrl==''?'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/drug.svg':item.imgUrl" mode="aspectFill"></image>
+								<image :src="item.imgUrl" mode="aspectFill"></image>
 							</view>
 							<view class="info-box">
 								<view>
@@ -77,10 +103,12 @@
 								</view>
 								<view class="price-num">
 									<view class="price">
-										<text class="unit">积分:</text>
-										<text class="num"  >{{item.integral}}</text>
+										<text class="num">{{item.integral}}</text>
+										<text class="unit">积分</text>
+										<text class="num" v-if="item&&item.cash>0">+{{$formatNum(item.cash)}}</text>
+										<text class="unit" v-if="item&&item.cash>0">元</text>
 									</view>
-									<view class="num"  >x1</view>
+									<view class="num">x{{item.num}}</view>
 								</view>
 							</view>
 						</view>
@@ -100,9 +128,25 @@
 							<text class="text">{{order.createTime}}</text>
 						</view>
 					 
+						<view   class="item" v-if="order.discountIntegral">
+							<text class="label">优惠积分</text>
+							<text class="text">-{{order.discountIntegral||0}}</text>
+						</view>
+						<view   class="item">
+							<text class="label">支付积分</text>
+							<text class="text">{{order.integral||0}}</text>
+						</view>
+						<view   class="item" v-if="order.discountCash">
+							<text class="label">优惠金额</text>
+							<text class="text">-¥{{order.discountCash||0}}</text>
+						</view>
+						<view   class="item">
+							<text class="label">支付金额</text>
+							<text class="text">¥{{order.payMoney||0}}</text>
+						</view>
 						<view   class="item">
-							<text class="label">使用积分</text>
-							<text class="text"  >¥{{order.integral}}</text>
+							<text class="label">运费</text>
+							<text class="text">¥{{order.deliveryMoney||0}}</text>
 						</view>
 						<view   class="item" v-if="order.deliveryName!=null">
 						 	<text class="label">物流公司</text>
@@ -118,10 +162,13 @@
 		</view>
 		<!-- 按钮 -->
 		<view   class="btn-box">
-			<view class="btn cancel">
-				联系客服
-				<button class='contact-btn' open-type="contact">
-				</button>
+			<view class="btn pay" v-if="order.status==4" @click.stop="pay()">去支付</view>
+				<view class="btn cancel" v-if="order.status==4" @click.stop="cancelPay(item)">取消订单</view>
+				<view class="btn pay" v-if="order.deliverySn!=null" @click="showDelivery()">查看物流</view>
+				<view v-if="order.isAfterSales==1" class="btn cancel" @click="refund(item)">申请售后</view>
+				<view class="btn cancel">
+					联系客服
+				<button class='contact-btn' open-type="contact"></button>
 			</view>
 		</view>
 	</view>
@@ -129,13 +176,13 @@
 
 <script>
 	
-	import {getIntegralOrderById} from '@/api/integral.js'
+	import {getIntegralOrderById,cannelOrder} from './api/integral.js'
 	export default {
 		data() {
 			return {
 				orderId:null,
-				order:null,
-				item:null,
+				order:{},
+				list:[],
 		 
 			};
 		},
@@ -146,12 +193,25 @@
 			this.getIntegralOrderById()
 		},
 		methods: {
+			refund(item) {
+				// uni.navigateTo({
+				// 	url: './refundOrderProduct?orderId='+item.id
+				// })	
+				uni.navigateTo({
+					url: '/pages_user/integral/refundOrder?orderId='+item.orderId+'&orderCode='+item.orderCode
+				})	
+			},
+			showDelivery() {
+				uni.navigateTo({
+					url: '/pages_user/integralOrderDelivery?orderId='+this.orderId
+				})
+			},
 			getIntegralOrderById(){
 				var data={orderId:this.orderId};
 				getIntegralOrderById(data).then(res => {
 					if(res.code==200){
-						 this.order=res.data;
-						 this.item=JSON.parse(this.order.itemJson) 
+						this.order=res.data;
+						this.list = [].concat(JSON.parse(this.order.itemJson ?? '[]')).filter(Boolean);
 					}else{
 						uni.showToast({
 							icon:'none',
@@ -175,6 +235,27 @@
 					}
 				});
 			},
+			pay() {
+				 uni.navigateTo({
+				 	url: '/pages_user/integralPayment?orderId='+this.order.orderId
+				 })
+			},
+			cancelPay() {
+				cannelOrder({orderId:this.order.orderId}).then(res=>{
+					if(res.code ==200) {
+						uni.showToast({
+							title: '取消成功',
+							icon: 'none'
+						})
+						this.getIntegralOrderById()
+					} else {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none'
+						})
+					}
+				})
+			}
 		}
 	}
 </script>
@@ -191,7 +272,7 @@
 			left: 0;
 			z-index: 1;
 			background-color: #2583EB;
-			background: linear-gradient(#2583EB, #2EDAD4);
+			background: linear-gradient(#2583EB, #C0DBFD);
 			border-radius: 0rpx 0rpx 100rpx 100rpx;
 		}
 		.inner{
@@ -324,7 +405,7 @@
 							display: inline-block;
 							padding: 0 6upx;
 							height: 30upx;
-							background: linear-gradient(90deg, #2583EB 0%, #2EDAD4 100%);
+							background: linear-gradient(90deg, #2583EB 0%, #C0DBFD 100%);
 							border-radius: 4upx;
 							margin-right: 10upx;
 							font-size: 22upx;

+ 68 - 29
pages_user/integralOrderList.vue

@@ -2,7 +2,8 @@
 	<view class="content">
 		<view class="top-fixed">
 			 <u-tabs
-			  :scrollable="false"
+			:current="current"
+			  :scrollable="true"
 			  :list="tabs"  
 			  lineColor="#2583EB"
 			 @change="tabChange">
@@ -16,21 +17,18 @@
 					<view class="ordersn-box" @click="showDetail(item)">
 						<view class="num">订单号:{{item.orderCode}}</view>
 						<view class="status-box">
-							<text   class="text info" v-if="item.status==1">	
+							<text   class="text success" v-if="item.status>1&&item.status<5">
 							{{$getDictLabelName(orderStatusOptions,item.status)}}
 							</text>
-							<text   class="text success" v-if="item.status>1">
-							{{$getDictLabelName(orderStatusOptions,item.status)}}
-							</text>
-							<text   class="text info" v-if="item.status<0">
+							<text   class="text info" v-else>
 							{{$getDictLabelName(orderStatusOptions,item.status)}}
 							</text>
 						</view>
 					</view>
 					<view  class="drug-list"  >
-						<view @click="showDetail(item)"    v-for="(subItem,subIndex) in item.items" :key="subIndex" class="drug-item" >
+						<view @click="showDetail(item)" v-for="(subItem,subIndex) in item.items" :key="subIndex" class="drug-item" >
 							<view class="img-box">
-								<image :src="subItem.imgUrl==''?'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/drug.svg':subItem.imgUrl" mode="aspectFill"></image>
+								<image :src="subItem.imgUrl==''?'https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/drug.svg':subItem.imgUrl" mode="aspectFill"></image>
 							</view>
 							<view class="drug-info"  >
 								<view>
@@ -40,28 +38,36 @@
 								</view>
 								<view class="num-box">
 									<view class="price">
-										<text class="unit">积分</text>
 										<text class="num" >{{subItem.integral}}</text>
+										<text class="unit">积分</text>
+										<text class="num" v-show="subItem.cash>0">+{{subItem.cash}}</text>
+										<text class="unit" v-show="subItem.cash>0">元</text>
 									</view>
-									<view class="amount"  >x1</view>
+									<view class="amount"  >x{{subItem.num}}</view>
 								</view>
 							</view>
 						</view>
 						<!-- 实付金额、按钮 -->
 						<view class="bottom-box">
 							<view class="amount-paid">
-								<text class="label">使用积分:</text>
+								<!-- <text class="label">使用积分:</text> -->
 								<view class="price-box">
-									<view class="unit">¥</view>
 									<view class="num" >{{item.integral}}</view>
+									<view class="unit">积分</view>
+									<view class="unit" v-show="item.payMoney>0">+</view>
+									<view class="num" v-show="item.payMoney>0">{{item.payMoney}}</view>
+									<view class="unit" v-show="item.payMoney>0">元</view>
 								</view>
 							</view>
 							<view class="btn-box">
-								<view    class="btn cancel">
+								<view class="btn pay" v-if="item.status==4" @click.stop="pay(item)">去支付</view>
+								<view class="btn cancel" v-if="item.status==4" @click.stop="cancelPay(item)">取消订单</view>
+								<view v-if="item.isAfterSales==1" class="btn cancel" @click="refund(item)">申请售后</view>
+								<!-- <view class="btn cancel">
 									联系客服
 									<button class='contact-btn' open-type="contact">
 									</button>
-								</view>
+								</view> -->
 							</view>
 						</view>
 					</view>
@@ -73,7 +79,7 @@
 
 <script>
  import {getDictByKey} from '@/api/common.js'
- import {getIntegralOrderList} from '@/api/integral.js'
+ import {getIntegralOrderList,cannelOrder} from './api/integral.js'
  import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  
  export default {
@@ -85,17 +91,13 @@
 			status:"0",
 			tabs: [
 				{name:"全部",id:"0"},
+				{name:"待支付",id:"4"},
 				{name:"待发货",id:"1"},
 				{name:"待收货",id:"2"},
 				{name:"已完成",id:"3"},
-				{name:"已取消",id:"-1"}
+				{name:"已取消",id:"5"},
 			],
 			mescroll:null,
-			downOption: {
-				//下拉刷新
-				use: true,
-				auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
-			},
 			// 上拉加载的配置
 			upOption: {
 				onScroll:false,
@@ -107,17 +109,25 @@
 				noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
 				textNoMore:"已经到底了",
 				empty: {
-					icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
+					icon:'https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/empty_icon.png',
 					tip: '暂无数据'
 				}
 			},
 			// 列表数据
-			dataList: []
+			dataList: [],
+			current: 0
  		}
  	},
-	onLoad() {
+	onLoad(option) {
+		this.current = option.current || 0
+		this.status = this.tabs[this.current].id
 		this.getDictByKey("sys_integral_order_status");
 	},
+	onShow() {
+		if(this.mescroll) {
+			this.mescroll.resetUpScroll()
+		}
+	},
  	methods: {
 		getDictByKey(key){
 			var data={key:key}
@@ -156,10 +166,10 @@
 			};
 			getIntegralOrderList(data).then(res => {
 				if(res.code==200){
-					res.data.list.forEach(function(value, index, array){
-						value.items=[];
-						value.items.push(JSON.parse(value.itemJson))
-					})
+					res.data.list = res.data.list.map(v => ({
+					  ...v,
+					  items: [].concat(JSON.parse(v.itemJson || '[]')).filter(Boolean)
+					}));
 					//设置列表数据
 					if (page.num == 1) {
 						that.dataList = res.data.list; 
@@ -186,6 +196,35 @@
 				url: './integralOrderDetails?orderId=' + item.orderId
 			})
 		},
+		pay(item) {
+			 uni.navigateTo({
+			 	url: '/pages_user/integralPayment?orderId='+item.orderId
+			 })
+		},
+		cancelPay(item) {
+			cannelOrder({orderId:item.orderId}).then(res=>{
+				if(res.code ==200) {
+					uni.showToast({
+						title: '取消成功',
+						icon: 'none'
+					})
+					this.mescroll.resetUpScroll()
+				} else {
+					uni.showToast({
+						title: res.msg,
+						icon: 'none'
+					})
+				}
+			})
+		},
+		refund(item) {
+			// uni.navigateTo({
+			// 	url: './refundOrderProduct?orderId='+item.id
+			// })	
+			uni.navigateTo({
+				url: '/pages_user/integral/refundOrder?orderId='+item.orderId+'&orderCode='+item.orderCode
+			})	
+		},
  	}
  }
  
@@ -274,7 +313,7 @@
 								display: inline-block;
 								padding: 0 6upx;
 								height: 30upx;
-								background: linear-gradient(90deg, #2583EB 0%, #2EDAD4 100%);
+								background: linear-gradient(90deg, #2583EB 0%, #C0DBFD 100%);
 								border-radius: 4upx;
 								margin-right: 10upx;
 								font-size: 22upx;

+ 197 - 24
pages_user/integralOrderPay.vue

@@ -9,7 +9,7 @@
 					</view>
 				</view>
 				<view class="arrow-box">
-					<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/arrow_gray.png" mode=""></image>
+					<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/arrow_gray.png" mode=""></image>
 				</view>
 			</view>
 			<view class="address-box" v-if="address!=null" @click="openAddress()">
@@ -23,14 +23,14 @@
 					</view>
 				</view>
 				<view class="arrow-box">
-					<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/arrow_gray.png" mode=""></image>
+					<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/arrow_gray.png" mode=""></image>
 				</view>
 			</view>
 			<!-- 药品列表 -->
 			<view class="goods-list">
-				<view     class="item">
+				<view class="item">
 					<view class="img-box">
-						<image :src="item.imgUrl==''?'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/drug.svg':item.imgUrl" mode="aspectFill"></image>
+						<image :src="item.imgUrl==''?'https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/drug.svg':item.imgUrl" mode="aspectFill"></image>
 					</view>
 					<view class="info-box">
 						<view>
@@ -41,8 +41,10 @@
 						</view>
 						<view class="price-num">
 							<view class="price">
-								<text class="unit">积分</text>
 								<text class="num">{{item.integral}}</text>
+								<text class="unit">积分</text>
+								<text class="num" v-if="item&&item.cash>0">+{{$formatNum(item.cash)}}</text>
+								<text class="unit" v-if="item&&item.cash>0">元</text>
 							</view>
 							<view class="num"  >x1</view>
 						</view>
@@ -50,38 +52,122 @@
 				</view>
 			</view>
 			<view class="other-info">
+				<!-- 商品积分,优惠积分,所需积分,应付金额,优惠金额,运费,支付金额, -->
 				<view class="item">
 					<view class="left">
-						<text class="label">所需积分:</text>
+						<text class="label">商品总积分:</text>
 					</view>
 					<view class="right">
-						<text class="text">{{item.integral}}</text>
+						<text class="text">{{priceInfo.totalIntegral}}</text>
+					</view>
+				</view>
+				<view class="item" v-if="priceInfo.discountIntegral">
+					<view class="left">
+						<text class="label">优惠积分:</text>
+					</view>
+					<view class="right">
+						<text class="text">-{{priceInfo.discountIntegral}}</text>
+					</view>
+				</view>
+				<view class="item">
+					<view class="left">
+						<text class="label">支付积分:</text>
+					</view>
+					<view class="right">
+						<text class="text">{{priceInfo.integral}}</text>
 					</view>
 				</view>
-			</view>
-			<view class="other-info">
 				<view class="item">
 					<view class="left">
-						<text class="label">我的积分:</text>
+						<text class="label">总金额:</text>
 					</view>
 					<view class="right">
-						<text class="text">{{integral}}</text>
+						<text class="text">¥{{priceInfo.totalCash || '0'}}</text>
 					</view>
 				</view>
+				<view class="item" v-if="priceInfo.discountCash">
+					<view class="left">
+						<text class="label">优惠金额:</text>
+					</view>
+					<view class="right">
+						<text class="text">-¥{{priceInfo.discountCash || '0'}}</text>
+					</view>
+				</view>
+				<view class="item">
+					<view class="left">
+						<text class="label">运费:</text>
+					</view>
+					<view class="right">
+						<text class="text">¥{{priceInfo.deliveryMoney || '0'}}</text>
+					</view>
+				</view>
+				<view class="item" v-if='priceInfo.cash>0'>
+					<view class="left">
+						<text class="label">支付金额:</text>
+					</view>
+					<view class="right">
+						<text class="text">¥{{$formatNum(priceInfo.cash)}}</text>
+					</view>
+				</view>
+				<!-- <view class="item" @click.stop="openCoupon()">
+					<view class="left">
+						<text class="label">优惠券:</text>
+					</view>
+					<view class="right">
+						<text class="text">{{couponText}}</text>
+						<image v-if="userCouponId!=0" @click.stop="delCoupon()" class="ic-close" src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/close.png"></image>
+						<image  class="ic-back" src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/arrow_gray.png"></image>
+					</view>
+				</view> -->
+			</view>
+			<view class="pay-type" v-if='item.cash>0'>
+				<view class="title">支付方式</view>
+				<radio-group>
+					<view class="item">
+						<view class="left" >
+							<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/wecha_pay.png" mode=""></image>
+							<text class="text">全款支付</text>
+						</view>
+						<label>
+							<radio :value="1" :checked="payType=='1'" color="#2583EB" />
+						</label>
+					</view>
+				</radio-group>
 			</view>
+			<!-- 备注 -->
+			<!-- <view class="remarks" v-if='item.cash>0&&order!=null'>
+				<input type="text" v-model="order.remark" placeholder="备注留言(选填)" placeholder-class="input" />
+			</view> -->
 		</view>
 		 
 		<!-- 底部按钮 -->
 		<view class="btn-box">
-			<view class="btn" v-if="item!=null" @click="payOrder()">立即兑换</view>
+			<view class="btn" v-if="item!=null" @click="payOrder()">{{item.cash>0?'立即支付':'立即兑换'}}</view>
 		</view>
+		<u-popup :closeable="true" :show="couponShow" :round="10" mode="bottom" @close="close">
+			<view class="coupon">
+				<view class="coupon-box" v-if="coupons.length>0" >
+				   <view @click="couponSelect(item)" class="coupon-item" v-for="(item) in coupons">
+				 	<!-- <campaignCoupon :couponPopupInfo="item"></campaignCoupon> -->
+				   </view>
+				</view>
+				<view class="empty" v-if="coupons.length==0">
+					<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/empty_icon.png"></image>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
 <script>
-	import {getIntegralGoodsById,createOrder} from '@/api/integral.js'
+	// import campaignCoupon from './components/campaignCoupon.vue'
+	import { getMyCouponList } from '@/api/user.js'
+	import {getIntegralGoodsById,createOrder,compute} from './api/integral.js'
 	import {getUserInfo} from '@/api/user'
 	export default {
+		// components:{
+		// 	campaignCoupon
+		// },
 		data() {
 			return {
 				addressId:null,
@@ -90,6 +176,21 @@
 				order:null,
 				item:null,
 				integral: 0,
+				payTypes: [],
+				payType: '1',
+				couponText:"请选择优惠券",
+				userCouponId:0,
+				coupons:[],
+				couponShow:false,
+				priceInfo: {
+					totalIntegral:0,
+					integral:0,
+					discountIntegral:0,
+					totalCash:0,
+					cash:0,
+					discountCash:0,
+					deliveryMoney:0,
+				}
 			}
 		},
 		onLoad(option) {
@@ -99,6 +200,7 @@
 				that.addressId=e.addressId;
 			 	that.address=e;
 				that.address.address=e.province+e.city+e.district+e.detail
+				that.compute()
 			})
 			this.getIntegralGoodsById();
 			this.getUserInfo();
@@ -107,6 +209,24 @@
 			uni.$off('updateAddress')
 		},
 		methods: {
+			couponSelect(item){
+				this.couponShow = false;
+				//计算金额
+				this.userCouponId=item.id;
+				console.log(item)
+				this.couponText=item.price+"元优惠券"
+				this.compute()
+			},
+			close() {
+				this.couponShow = false
+			},
+			openCoupon(){
+				this.couponShow=true;
+			},
+			delCoupon(){
+				this.userCouponId=0;
+				this.couponText="请选择优惠券";
+			},
 			getUserInfo(){
 				getUserInfo().then(
 					res => {
@@ -119,14 +239,36 @@
 					rej => {}
 				);
 			},
-			getIntegralGoodsById(){
+			getMyCouponList(){
+				const data = {
+					status: 0,
+					pageNum: 1,
+					pageSize: 50,
+					couponType: 7,
+					goodsId: this.goodsId
+				}
+				getMyCouponList(data).then(
+					res => {
+						if(res.code==200){
+							this.coupons=res.data.list;
+							if(this.coupons&&this.coupons.length>0) {
+								this.userCouponId=this.coupons[0].id;
+								this.couponText= this.coupons[0].title
+							}
+						}
+					},
+					err => {
+					}
+				);
+			},
+			async getIntegralGoodsById(){
+				// await this.getMyCouponList();
 				var data={goodsId:this.goodsId};
-				console.log(data)
 				getIntegralGoodsById(data).then(
 					res => {
 						if(res.code==200){
 							this.item=res.data;
-							 
+							this.compute()
 						}else{
 							 
 						}
@@ -151,6 +293,8 @@
 				var data = {
 					goodsId:this.goodsId,
 					addressId:this.addressId,
+					activityId: this.item.activityId,
+					userCouponId: this.userCouponId
 				};
 				var that=this;
 				uni.showLoading();
@@ -162,16 +306,28 @@
 								tmplIds: temps,
 								success(e) {
 									setTimeout(function(){
-										uni.redirectTo({
-											url:"./integralOrderPaySuccess?orderId="+res.order.orderId
-										}) 
+										if(!res.order.payMoney==0) {
+											uni.redirectTo({
+												url:"./integralOrderPaySuccess?orderId="+res.order.orderId
+											})
+										} else {
+											uni.redirectTo({
+												url:"./integralPayment?orderId="+res.order.orderId
+											})
+										}
 									},200);
 								},
 								fail(e) {
 									setTimeout(function(){
-										uni.redirectTo({
-											url:"./integralOrderPaySuccess?orderId="+res.order.orderId
-										}) 
+										if(!res.order.payMoney) {
+											uni.redirectTo({
+												url:"./integralOrderPaySuccess?orderId="+res.order.orderId
+											})
+										} else {
+											uni.redirectTo({
+												url:"./integralPayment?orderId="+res.order.orderId
+											})
+										}
 									},200);
 								}
 							})
@@ -185,6 +341,23 @@
 					rej => {}
 				);
 				
+			},
+			compute() {
+				const param = {
+					userCouponId: this.userCouponId || null,
+					userAddressId: this.addressId,
+					goodsId: this.goodsId,
+				}
+				compute(param).then(res=>{
+					if(res.code == 200) {
+						this.priceInfo = res.data
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: res.msg,
+						});
+					}
+				})
 			}
 		}
 	}
@@ -198,7 +371,7 @@
 			min-height: 171upx;
 			background: #FFFFFF;
 			border-radius: 16upx;
-			background-image: url(https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/address_bg.png);
+			background-image: url(https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/address_bg.png);
 			background-repeat: no-repeat;
 			background-size: 100% 30upx;
 			background-position: left bottom;
@@ -279,7 +452,7 @@
 							display: inline-block;
 							padding: 0 6upx;
 							height: 30upx;
-							background: linear-gradient(90deg, #2583EB 0%, #2EDAD4 100%);
+							background: linear-gradient(90deg, #2583EB 0%, #C0DBFD 100%);
 							border-radius: 4upx;
 							margin-right: 10upx;
 							font-size: 22upx;

+ 6 - 2
pages_user/integralOrderPaySuccess.vue

@@ -18,9 +18,13 @@
 						<view class="copy-btn" @click="copyTest(order.orderCode)">复制</view>
 					</view>
 				</view>
+				<view class="item">
+					<text class="label">支付积分</text>
+					<text class="text">{{order.integral || 0}}</text>
+				</view>
 				<view class="item">
 					<text class="label">支付金额</text>
-					<text class="text">{{order.integral}}</text>
+					<text class="text">¥{{order.payMoney || 0}}</text>
 				</view>
 				<view class="item">
 					<text class="label">兑换时间</text>
@@ -35,7 +39,7 @@
 </template>
 
 <script>
-	import {getIntegralOrderById} from '@/api/integral.js'
+	import {getIntegralOrderById} from './api/integral.js'
 	export default {
 		data() {
 			return {

+ 391 - 0
pages_user/integralPayment.vue

@@ -0,0 +1,391 @@
+<template>
+	<view>
+		<view class="inner-box" v-if="order!=null">
+			<!-- 时间、价格 -->
+			<view class="time-price">
+				<text class="time">订单金额</text>
+				<view class="price-box">
+					<text class="unit">¥</text>
+					<text class="num">{{$formatNum(order.payMoney)}}</text>
+				</view>
+			</view>
+			<!-- 订单详情查看 -->
+			<view class="order-info">
+				<view class="title">订单信息</view>
+				<view class="item">
+					<text class="label">订单编号</text>
+					<view class="sn-box">
+						<text class="text">{{order.orderCode}}</text>
+						<view class="copy-btn" @click="copyTest(order.orderCode)">复制</view>
+					</view>
+				</view>
+				<view class="item">
+					<text class="label">下单时间</text>
+					<text class="text">{{order.createTime}}</text>
+				</view>
+				<view class="item">
+					<text class="label">使用积分</text>
+					<text class="text">{{order.integral}}</text>
+				</view>
+			</view>
+		</view>
+		<!-- 底部按钮 -->
+		<view class="btn-box">
+			<view class="btn" v-if="order!=null" @click="payOrder()">立即支付</view>
+			<!-- <view class="btn1" v-if="order!=null"    >
+				亲友代付
+				<button class='share-btn' data-name="shareBtn" open-type="share">
+				</button>
+			</view> -->
+		</view>
+	</view>
+</template>
+
+<script>
+	import {getIntegralOrderById,payment} from './api/integral.js'
+	export default {
+		data() {
+			return {
+				payMethod:null,
+				orderId:null,
+				order:null,
+				
+			}
+		},
+		onLoad(option) {
+			this.orderId=option.orderId;
+			this.payMethod=option.payMethod;
+			if(this.payMethod=='app') {
+				this.getIntegralById();
+			}
+		},
+		onShow() {
+			if(this.payMethod!='app') {
+				//防止app进来的拉起的支付,关闭支付页重复调用
+				this.getIntegralById();
+			}
+		},
+		methods: {
+			copyTest(text) {
+				// 复制方法
+				uni.setClipboardData({
+					data:text,
+					success:()=>{
+						uni.showToast({
+							title:'内容已成功复制到剪切板',
+							icon:'none'
+						})
+					}
+				});
+			},
+			getIntegralById(){
+				var data={orderId:this.orderId};
+				console.log(data)
+				getIntegralOrderById(data).then(
+					res => {
+						if(res.code==200){
+							this.order=res.data
+							if(this.payMethod!=null&&this.payMethod=='app'){
+								this.payOrder();
+							}
+						}else{
+							 
+						}
+					},
+					rej => {}
+				);
+			},
+			payOrder(){
+				var data = {
+					orderId:this.orderId,
+					appId: getApp().globalData.appId
+				};
+				var that=this;
+				uni.showLoading();
+				payment(data).then(
+					res => {
+						if(res.code==200){
+							if(res.isPay==0){
+								if(res.type=="tz"){
+									uni.setStorageSync("ztPayUrl",res.data.body.url)
+									uni.navigateTo({
+										url:"/pages_order/tzPay"
+									})
+								}
+								if(res.type=="yb"){
+									var payData=JSON.parse(res.data.prePayTn)
+									console.log(payData)
+									uni.requestPayment({
+									 	provider: 'wxpay',
+									 	timeStamp: payData.timeStamp,
+									 	nonceStr: payData.nonceStr,
+									 	package: payData.package,
+									 	signType: payData.signType,
+									 	paySign: payData.paySign,
+									 	success: function(res) {
+											console.log(that.order.orderId)
+									 		 uni.hideLoading();
+											 uni.redirectTo({
+											 	url:"./integralOrderPaySuccess?orderId="+that.order.orderId
+											 }) 
+											 
+									 	},
+									 	fail: function(err) {
+											uni.showToast({
+												icon:'none',
+												title:'fail:' + JSON.stringify(err),
+											});
+									 		uni.hideLoading();
+											
+									 	}
+									});
+									
+								}
+								else if(res.type=="hf"){
+									var payData=JSON.parse(res.data.pay_info)
+									console.log(payData)
+									uni.requestPayment({
+									 	provider: 'wxpay',
+									 	timeStamp: payData.timeStamp,
+									 	nonceStr: payData.nonceStr,
+									 	package: payData.package,
+									 	signType: payData.signType,
+									 	paySign: payData.paySign,
+									 	success: function(res) {
+											console.log(that.order.orderId)
+									 		 uni.hideLoading();
+											 uni.redirectTo({
+											 	url:"./integralOrderPaySuccess?orderId="+that.order.orderId
+											 }) 
+											 
+									 	},
+									 	fail: function(err) {
+											uni.showToast({
+												icon:'none',
+												title:'fail:' + JSON.stringify(err),
+											});
+									 		uni.hideLoading();
+											
+									 	}
+									});
+									
+								}
+								else if(res.type=="wx"){
+									uni.requestPayment({
+									 	provider: 'wxpay',
+									 	timeStamp: res.data.timeStamp,
+									 	nonceStr: res.data.nonceStr,
+									 	package: res.data.packageValue,
+									 	signType: res.data.signType,
+									 	paySign: res.data.paySign,
+									 	success: function(res) {
+											console.log(that.order.orderId)
+									 		 uni.hideLoading();
+											 uni.redirectTo({
+											 	url:"./integralOrderPaySuccess?orderId="+that.order.orderId
+											 }) 
+											 
+									 	},
+									 	fail: function(err) {
+											uni.showToast({
+												icon:'none',
+												title:'fail:' + JSON.stringify(err),
+											});
+									 		uni.hideLoading();
+											
+									 	}
+									});
+									
+								}
+							}
+							else{
+								uni.hideLoading();
+								uni.redirectTo({
+									url:"./integralOrderPaySuccess?orderId="+that.order.orderId
+								}) 
+							}
+						}else{
+							uni.showToast({
+								icon:'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
+				
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.inner-box{
+		padding: 20upx 20upx 300upx;
+		.time-price{
+			box-sizing: border-box;
+			padding: 50upx 0upx;
+			background: #FFFFFF;
+			border-radius: 16upx;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			.time{
+				font-size: 32upx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #222222;
+				line-height: 1;
+				text-align: center;
+			}
+			.desc{
+				margin: 30upx 0upx 15upx;
+				font-size: 26upx;
+				font-family: PingFang SC;
+				color: #999999;
+				line-height: 1;
+				text-align: center;
+			}
+			.price-box{
+				display: flex;
+				align-items: flex-end;
+				margin-top: 28upx;
+				.unit{
+					font-size: 32upx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #FF6633;
+					line-height: 1.3;
+					margin-right: 10upx;
+				}
+				.num{
+					font-size: 56upx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #FF6633;
+					line-height: 1;
+				}
+			}
+		}
+		.order-info{
+			margin-top: 20upx;
+			background: #FFFFFF;
+			border-radius: 16upx;
+			padding: 40upx 30upx;
+			.title{
+				font-size: 30upx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #222222;
+				line-height: 1;
+			}
+			.item{
+				margin-top: 40upx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				.label{
+					font-size: 26upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #666666;
+					line-height: 1;
+				}
+				.text{
+					font-size: 26upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #222222;
+					line-height: 32upx;
+				}
+				.cont-text{
+					font-size: 26upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #666666;
+					.bold{
+						color: #111111;
+					}
+				}
+				.sn-box{
+					display: flex;
+					align-items: center;
+					.copy-btn{
+						width: 58upx;
+						height: 32upx;
+						line-height: 32upx;
+						text-align: center;
+						font-size: 22upx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #222222;
+						background: #F5F5F5;
+						border-radius: 4upx;
+						margin-left: 24upx;
+					}
+				}
+				 
+			}
+			.line{
+				width: 100%;
+				height: 1px;
+				background: #F0F0F0;
+				margin-top: 30upx;
+			}
+		}
+	}
+	
+	
+	.btn-box{
+	 	z-index: 9999;
+	 	width: 100%;
+	 	padding: 30rpx 30upx 0rpx;
+	 	position: fixed;
+	 	bottom: 0;
+	 	left: 0;
+	 	box-sizing: border-box;
+	 	background-color: #ffffff;
+	 	display: flex;
+		flex-direction: column;
+	 	align-items: center;
+	 	justify-content: center;
+	 	.btn{
+			margin-bottom: 20rpx;
+	 		width: 100%;
+	 		height: 88upx;
+	 		line-height: 88upx;
+	 		text-align: center;
+	 		font-size: 34upx;
+	 		font-family: PingFang SC;
+	 		font-weight: 400;
+	 		color: #FFFFFF;
+	 		background: #2583EB;
+	 		border-radius: 10upx;
+			position: relative;
+	 	}
+		.btn1{
+			margin-bottom: 20rpx;
+			width: 100%;
+			height: 88upx;
+			line-height: 88upx;
+			text-align: center;
+			font-size: 34upx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #2583EB;
+			border: 1rpx solid #2583EB;
+			border-radius: 10upx;
+			position: relative;
+			.share-btn {
+				top:0rpx;
+				left:0rpx;
+				position: absolute;
+				width: 100%;
+				height: 88upx;
+				display: flex;
+				opacity: 0;
+			}
+		}
+	}
+	 
+</style>

+ 1 - 1
pages_user/shopping/storeOrderDetail.vue

@@ -359,7 +359,7 @@
 			},
 			express(){
 				uni.navigateTo({
-					url: './storeOrderDelivery?orderId='+this.order.id
+					url: '/pages_user/shopping/storeOrderDelivery?orderId='+this.order.id
 				})
 			},
 			cancel(){

+ 9 - 0
utils/tools.js

@@ -209,6 +209,15 @@ export function caculateTimeago(dateTimeStamp,type) {
     return result;
   }
   
+  /**
+   * 金额最多保留2位小数,去除多余的末尾0
+   * @param {Number} value
+   */
+export function formatNum(value) {
+  if (value === null || value === undefined || isNaN(Number(value))) return '0'
+  return parseFloat(Number(value).toFixed(2)).toString()
+}
+
   /**
    * 格式销售数量
    * @param {Number} 数字