8 커밋 3c8fda5708 ... 7249588505

작성자 SHA1 메시지 날짜
  liujiaxin 7249588505 积分 3 주 전
  liujiaxin 8436eacb8a 积分 3 주 전
  liujiaxin 5e22f99918 积分 3 주 전
  liujiaxin 5f820d34e3 积分 1 개월 전
  liujiaxin 185304798f 积分 1 개월 전
  liujiaxin c1a052277e first commit 1 개월 전
  liujiaxin 8881fe3928 样式 1 개월 전
  liujiaxin def3fea2e7 样式 1 개월 전

+ 73 - 0
api/integral.js

@@ -0,0 +1,73 @@
+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 completionReceive(data) {
+  	return request(`/app/live/completion/receive?recordId=${data}`,data,'POST','application/json;charset=UTF-8');
+ }
+ // 获取用户未领取的积分列表
+ export function completionUnreceived(data) {
+  	return request('/app/live/completion/unreceived',data,'GET','application/json;charset=UTF-8');
+ }
+ // 查询用户积分领取记录
+ export function completionRecords(data) {
+  	return request('/app/live/completion/records',data,'GET','application/json;charset=UTF-8');
+ }
+ // 查询用户积分余额和看直播信息统计
+ export function completionInfo(data) {
+  	return request('/app/live/completion/info',data,'GET','application/json;charset=UTF-8');
+ }

+ 14 - 3
common/request.js

@@ -13,8 +13,13 @@ export default class Request {
 		let path = 'https://userapp.klbycp.com/store'; //百域承品
 		let path2 = 'https://userapp.klbycp.com'; //百域承品
 
-		// let path = 'http://gd3c3bb9.natappfree.cc/store'; //本地
-		// let path2 = 'http://gd3c3bb9.natappfree.cc'; //本地
+
+		// let path = 'http://ac6af934.natappfree.cc/store'; //百域承品 夏伟
+		// let path2 = 'http://ac6af934.natappfree.cc'; //百域承品 夏伟
+
+		// let path = 'http://qeeaf625.natappfree.cc/store'; //本地
+		// let path2 = 'http://qeeaf625.natappfree.cc'; //本地
+
 
 		let type = 0
 		uni.setStorageSync('requestPath', path2)
@@ -25,6 +30,7 @@ export default class Request {
 		if (router.indexOf("/live/liveData/like") != -1) {
 			path = 'https://im.fhhx.runtzh.com';
 		}
+
 if (router.indexOf("/app/order/getMyMergedOrderList") != -1 || router.indexOf("/app/order/deleteOrder") != -1) {
 			path = 'https://userapp.klbycp.com';
 		}
@@ -59,6 +65,11 @@ if (router.indexOf("/app/order/getMyMergedOrderList") != -1 || router.indexOf("/
 		}
 
 
+		//积分商城
+		if (router.indexOf("/integral") !== -1) {
+			path = path2
+		}
+
 		// 企微看课
 		if (router.indexOf("/course_auto") != -1) {
 			type = 2
@@ -89,7 +100,7 @@ if (router.indexOf("/app/order/getMyMergedOrderList") != -1 || router.indexOf("/
 				header: {
 					// 'Content-Type': 'application/x-www-form-urlencoded',
 					'Content-Type': httpContentType,
-					'appid':wx.getAccountInfoSync().miniProgram.appId,
+					'appid': wx.getAccountInfoSync().miniProgram.appId,
 					'AppToken': token
 				},
 				url: `${path}${router}`,

+ 105 - 31
pages.json

@@ -12,7 +12,7 @@
 				"navigationBarTitleText": "授权登录",
 				"navigationStyle": "custom"
 			}
-		},{
+		}, {
 			"path": "pages/auth/numberlogin",
 			"style": {
 				"navigationBarTitleText": "电话号码登录",
@@ -563,6 +563,84 @@
 		{
 			"root": "pages_user",
 			"pages": [{
+					"path": "user/cart",
+					"style": {
+						"navigationBarTitleText": "购物车",
+						"enablePullDownRefresh": false,
+						"navigationBarBackgroundColor":"#ffffff",
+						"navigationBarTextStyle":"black"
+					}
+				}, {
+					"path": "user/integralLogsList",
+					"style": {
+						"navigationBarTitleText": "获得记录",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+					}
+
+				},{
+					"path": "user/integralOrderList",
+					"style": {
+						"navigationBarTitleText": "兑换订单",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+					}
+
+				},{
+					"path": "user/integralOrderDetails",
+					"style": {
+						"navigationBarTitleText": "订单详情"
+					}
+
+				}, {
+					"path": "user/integralOrderPaySuccess",
+					"style": {
+						"navigationBarTitleText": "兑换结果",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+					}
+
+				}, {
+					"path": "user/integralPayment",
+					"style": {
+						"navigationBarTitleText": "支付订单",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+					}
+
+				}, {
+					"path": "user/integralGoodsDetails",
+					"style": {
+						"navigationBarTitleText": "商品详情",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+					}
+
+				}, {
+					"path": "user/confirmIntegralOrder",
+					"style": {
+						"navigationBarTitleText": "积分兑换",
+						"enablePullDownRefresh": false,
+						"navigationBarBackgroundColor": "#ffffff",
+						"navigationBarTextStyle": "black"
+					}
+				}, {
+					"path": "user/integralGoodsList",
+					"style": {
+						"navigationBarTitleText": "积分商城",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+					}
+
+				}, {
+					"path": "user/integralOrderPay",
+					"style": {
+						"navigationBarTitleText": "积分兑换",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+					}
+
+				}, {
 					"path": "user/addPatient",
 					"style": {
 						"navigationBarTitleText": "创建百域档案",
@@ -873,7 +951,7 @@
 							"titleNView": false
 						}
 					}
-				},{
+				}, {
 					"path": "shareLive",
 					"style": {
 						"navigationBarTitleText": "分享直播间",
@@ -1078,10 +1156,10 @@
 					"style": {
 						"navigationStyle": "custom",
 						"enablePullDownRefresh": false
-						
+
 					}
 
-				},{
+				}, {
 					"path": "live/complaint",
 					"style": {
 						"navigationBarTitleText": "我的反馈",
@@ -1091,7 +1169,7 @@
 						}
 					}
 				},
-{
+				{
 					"path": "live/complaintList",
 					"style": {
 						"navigationBarTitleText": "反馈与投诉",
@@ -1108,7 +1186,7 @@
 						"enablePullDownRefresh": false
 					}
 
-				},{
+				}, {
 					"path": "live/integral",
 					"style": {
 						"navigationBarTitleText": "积分",
@@ -1162,7 +1240,7 @@
 						"enablePullDownRefresh": false
 					}
 
-				},{
+				}, {
 					"path": "live/storeOrderDelivery",
 					"style": {
 						"navigationBarTitleText": "物流信息",
@@ -1180,7 +1258,7 @@
 						"navigationBarTextStyle": "black"
 					}
 				},
-				
+
 				{
 					"path": "live/storeOrderRefundSubmit",
 					"style": {
@@ -1226,8 +1304,7 @@
 		},
 		{
 			"root": "pages_manage",
-			"pages": [
-				{
+			"pages": [{
 					"path": "login",
 					"style": {
 						"navigationBarTitleText": "登录",
@@ -1262,8 +1339,8 @@
 						"enablePullDownRefresh": false
 					}
 				}
-				
-				
+
+
 			]
 		},
 		{
@@ -1356,26 +1433,24 @@
 							"bounce": "none" // 页面回弹
 						}
 					}
-				},{
-					"path" : "voiceItem",
-					"style" : 
-					{
-						"navigationBarTitleText" : "声音录制",
+				}, {
+					"path": "voiceItem",
+					"style": {
+						"navigationBarTitleText": "声音录制",
 						"enablePullDownRefresh": false,
-						"navigationBarBackgroundColor":"#ffffff",
-						"navigationBarTextStyle":"black",
+						"navigationBarBackgroundColor": "#ffffff",
+						"navigationBarTextStyle": "black",
 						"app-plus": {
 							"bounce": "none" // 页面回弹
 						}
 					}
-				},{
-					"path" : "voiceList",
-					"style" : 
-					{
-						"navigationBarTitleText" : "声音录制",
+				}, {
+					"path": "voiceList",
+					"style": {
+						"navigationBarTitleText": "声音录制",
 						"enablePullDownRefresh": false,
-						"navigationBarBackgroundColor":"#ffffff",
-						"navigationBarTextStyle":"black",
+						"navigationBarBackgroundColor": "#ffffff",
+						"navigationBarTextStyle": "black",
 						"app-plus": {
 							"bounce": "none" // 页面回弹
 						}
@@ -1421,10 +1496,9 @@
 					}
 				},
 				{
-					"path" : "learn",
-					"style" : 
-					{
-						"navigationBarTitleText" : "百域生活方式指导",
+					"path": "learn",
+					"style": {
+						"navigationBarTitleText": "百域生活方式指导",
 						"enablePullDownRefresh": false
 					}
 				},
@@ -1514,7 +1588,7 @@
 			// 	"selectedIconPath": "/static/tabbar/shop_mall_sel.png",
 			// 	"text": "百域商城"
 			// },
-			
+
 			// {
 			// 	"pagePath": "pages/healthy/idea",
 			// 	"iconPath": "/static/tabbar/archive.png",

+ 8 - 2
pages/user/index.vue

@@ -109,6 +109,12 @@
 									mode=""></image>
 								<text class="text">积分管理</text>
 							</view> -->
+							<view class="item no-marin-bottom" @click="navgetTo('/pages_user/user/integralGoodsList')">
+								<image
+									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/integral.png"
+									mode=""></image>
+								<text class="text">积分商城</text>
+							</view>
 							<view class="item no-marin-bottom" @click="navgetTo('/pages_shopping/shopping/myCoupon')">
 								<image
 									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/mycoupon.png"
@@ -181,12 +187,12 @@
 
 
 							<!-- 测试用下面的 -->
-							<!-- <view class="item no-marin-bottom align-top" @click="navgetTo('/pages_course/livingList')">
+							<view class="item no-marin-bottom align-top" @click="navgetTo('/pages_course/livingList')">
 								<image
 									src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/integral.png"
 									mode=""></image>
 								<text class="text">直播</text>
-							</view> -->
+							</view>
 
 							<view class="item no-marin-bottom" @click="toManager()">
 								<image

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 644 - 129
pages_course/living.vue


+ 8 - 4
pages_course/livingList.vue

@@ -4,7 +4,7 @@
 			:down="downOption" :up="upOption">
 			<view class="list">
 				<view class="list-item" @click="goLive(item)" v-for="(item,index) in list" :key="index">
-					<image class="img"  v-if="item.liveImgUrl" :src="item.liveImgUrl"></image>
+					<image class="img" v-if="item.liveImgUrl" :src="item.liveImgUrl"></image>
 					<view class="info">
 						<text>{{item.liveName}}</text>
 					</view>
@@ -23,7 +23,8 @@
 		mixins: [MescrollMixin],
 		data() {
 			return {
-
+				liveId: 712,
+				recordId: 1,
 				list: [],
 				downOption: {
 					offset: 80,
@@ -42,6 +43,7 @@
 			}
 		},
 		onLoad() {
+			
 			// if (!uni.getStorageSync("AppToken")) {
 			// 	uni.navigateTo({
 			// 		url: '/pages/auth/login'
@@ -52,6 +54,7 @@
 
 		},
 		methods: {
+
 			mescrollInit(mescroll) {
 				this.mescroll = mescroll;
 			},
@@ -142,13 +145,14 @@
 					display: flex;
 					background-color: rgba(0, 0, 0, 0.6);
 					align-items: center;
-					text{
+
+					text {
 						white-space: nowrap;
 						overflow: hidden;
 						text-overflow: ellipsis;
 					}
 				}
-				
+
 			}
 
 			.list-item:nth-child(2n) {

+ 1 - 1
pages_shopping/live/confirmCreateOrder.vue

@@ -359,7 +359,7 @@
 					totalNum: this.totalNum,
 					couponUserId: this.couponUserId,
 					attrValueId: this.productValueSelect,
-                     appId: wx.getAccountInfoSync().miniProgram.appId
+					appId: wx.getAccountInfoSync().miniProgram.appId
 				}
 
 				return createliveOrder(data).then(res => {

+ 180 - 84
pages_shopping/live/integral.vue

@@ -24,6 +24,43 @@
 					<text class="num">{{integral}}</text>
 				</view>
 
+				<!-- 签到 -->
+				<!-- <view class="singn-content">
+					<view class="sign-in-box">
+						<view class="inner">
+							<view class="title-box">已连续签到<text class="num">{{totalDays}}</text>天</view>
+							<view class="sign-list">
+								<view v-for="(item,index) in records" :key="index"
+									:class="totalDays >= index+ 1?'item active':'item'">
+									<view class="line"></view>
+									<view class="right">
+										<image v-if="totalDays >= index+ 1"
+											src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/f3bdd5d388854e9a8f365904840c3b32.png"
+											mode=""></image>
+										<image v-else
+											src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/c593e551e4b246b981aaa58deb1fe725.png"
+											mode=""></image>
+										<text class="text">第{{ item.continuousDays}}天</text>
+									</view>
+								</view>
+							</view>
+						</view>
+						<view class="sign-btn-box">
+							<view class="btn" v-if="isDaySign==false" @click="doSign()">
+								<image
+									src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/295aa046433d4feb95b467c83f8b4096.png"
+									mode=""></image>
+								<text class="text">签到</text>
+							</view>
+							<view class="btn" v-else>
+								<image
+									src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/295aa046433d4feb95b467c83f8b4096.png"
+									mode=""></image>
+								<text class="text">签到</text>
+							</view>
+						</view>
+					</view>
+				</view> -->
 				<view class="content">
 					<!-- 积分列表 -->
 					<view class="points-cont">
@@ -48,13 +85,14 @@
 							<view v-for="(item,index) in list" :key="index" class="item">
 								<view class="left">
 									<text class="title">
-										{{item.logTypeName}}
+										<!-- {{item.logTypeName}} -->
+										直播间完课积分
 									</text>
 									<view class="time">{{item.createTime}}</view>
 								</view>
 								<view class="right">
 									<text v-if="item.integral<0" class="less">{{item.integral}}</text>
-									<text v-else class="add">+{{item.integral}}</text>
+									<text v-else class="add">+{{item.pointsAwarded}}</text>
 								</view>
 							</view>
 						</view>
@@ -71,16 +109,27 @@
 	import {
 		getUserIntegralInfo
 	} from '@/api/living.js' // 积分
+	import {
+		completionRecords,
+		completionInfo,doSign
+	} from '@/api/integral.js'
 
 
 	// import {getDictByKey} from '@/api/common.js'
 	// import {getUserSign,getUserIntegralLogsList,doSign} from '@/api/integral';
+	// import {
+	// 	doSign
+	// } from '@/api/integral';
 	export default {
 		comments() {
 			Loading
 		},
 		data() {
 			return {
+				totalDays: null,
+				records: null,
+				liveId: 712,
+				signNum: 0,
 				typeOptions: [],
 				top: 0,
 				integral: 0,
@@ -104,7 +153,13 @@
 			};
 		},
 		onLoad(option) {
-			this.getUserIntegralInfo()
+			if (option.liveId) {
+				this.liveId = option.liveId
+			}
+			console.log("进入积分页面了")
+			// this.getUserIntegralInfo()
+			this.completionRecords()
+			this.completionInfo()
 		},
 		computed: {
 			// 计算属性的 getter
@@ -113,6 +168,93 @@
 			},
 		},
 		methods: {
+			// 查询用户积分领取记录
+			completionRecords() {
+				if (!this.liveId) return;
+				const data = {
+					liveId: this.liveId
+				}
+				completionRecords(data).then((res) => {
+					if (res.code == 200) {
+						this.list = res.data
+						console.log("查询用户积分领取记录", res)
+					}
+				}).catch((error) => {
+
+				});
+			},
+
+			//查询用户积分余额和看直播信息统计
+			completionInfo() {
+				if (!this.liveId) return;
+				const data = {
+					liveId: this.liveId
+				}
+				completionInfo(data).then((res) => {
+					if (res.code == 200) {
+						this.integral = res.data.integral
+						this.records = res.data.records
+						this.totalDays = res.data.totalDays
+						console.log("查询用户积分余额和看直播信息统计", res)
+					}
+				}).catch((error) => {
+
+				});
+			},
+
+
+			doSign() {
+				var data = {};
+				// uni.showLoading({
+				// 	title:"正在加载中..."
+				// })
+				doSign(data).then(
+					res => {
+						// uni.hideLoading()
+						if (res.code == 200) {
+							uni.showToast({
+								icon: 'success',
+								title: res.msg,
+							});
+							this.list = [];
+							this.page.page = 1;
+							this.list = [];
+							this.loaded = false;
+							this.loading = false;
+							this.getUserIntegralLogsList();
+							this.getUserSign();
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+			getUserSign() {
+				getUserSign().then(
+					res => {
+						if (res.code == 200) {
+							this.data = res.member;
+							this.signNum = res.signNum;
+							this.isDaySign = res.isDaySign;
+							this.integral = res.integral;
+							this.sign = JSON.parse(res.sign);
+
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+
+
 			// 积分
 			getUserIntegralInfo() {
 				uni.showLoading({
@@ -122,13 +264,14 @@
 					uni.hideLoading()
 					if (res.code == 200) {
 						console.log("积分>>", res)
-						 // 处理列表数据,将"积分"替换为"积分"
-						      this.list = res.data.logs.map(item => {
-						        return {
-						          ...item,
-						          logTypeName: item.logTypeName ? item.logTypeName.replace(/积分/g, '积分') : item.logTypeName
-						        }
-						      })
+						// 处理列表数据,将"积分"替换为"积分"
+						this.list = res.data.logs.map(item => {
+							return {
+								...item,
+								logTypeName: item.logTypeName ? item.logTypeName.replace(/积分/g, '积分') :
+									item.logTypeName
+							}
+						})
 						this.integral = res.data.integral
 					}
 				}).catch(error => {
@@ -153,80 +296,33 @@
 				);
 
 			},
-			// doSign(){
-			// 	var data={};
-			// 	uni.showLoading({
-			// 		title:"正在加载中..."
-			// 	})
-			// 	doSign(data).then(
-			// 		res => {
-			// 			uni.hideLoading()
-			// 			if(res.code==200){
-			// 				uni.showToast({
-			// 					icon:'success',
-			// 					title: res.msg,
-			// 				});
-			// 				this.list=[];
-			// 				this.page.page=1;
-			// 				this.list=[];
-			// 				this.loaded=false;
-			// 				this.loading=false;
-			// 				this.getUserIntegralLogsList();
-			// 				this.getUserSign();
-			// 			}else{
-			// 				uni.showToast({
-			// 					icon:'none',
-			// 					title: res.msg,
-			// 				});
-			// 			}
-			// 		},
-			// 		rej => {}
-			// 	);
-			// },
-			// getUserSign(){
-			// 	getUserSign().then(
-			// 		res => {
-			// 			if(res.code==200){
-			// 				this.data=res.member;
-			// 				this.integral=res.integral;
-			// 				this.sign=JSON.parse(res.sign);
-
-			// 			}else{
-			// 				uni.showToast({
-			// 					icon:'none',
-			// 					title: "请求失败",
-			// 				});
-			// 			}
-			// 		},
-			// 		rej => {}
-			// 	);
-			// },
-
-			// getUserIntegralLogsList() {
-			//   let that = this;
-			//   if (that.loaded == true || that.loading == true) return;
-			//   that.loading = true;
-			//   uni.showLoading({
-			//   	title:"加载中..."
-			//   })
-			//   getUserIntegralLogsList(that.page).then(
-			//     res => {
-			//       that.loading = false;
-			//       that.loaded = res.data.list.length < that.page.pageSize;
-			//       that.page.page = that.page.page + 1;
-			//       that.list.push.apply(that.list, res.data.list);
-			// 	  uni.hideLoading()
-			//     },
-			//     err => {
-			// 		uni.hideLoading()
-			// 		uni.showToast({
-			// 				title: err.msg ,
-			// 				icon: 'none',
-			// 				duration: 2000
-			// 			});
-			//     }
-			//   );
-			// },
+
+
+			getUserIntegralLogsList() {
+				let that = this;
+				if (that.loaded == true || that.loading == true) return;
+				that.loading = true;
+				uni.showLoading({
+					title: "加载中..."
+				})
+				getUserIntegralLogsList(that.page).then(
+					res => {
+						that.loading = false;
+						that.loaded = res.data.list.length < that.page.pageSize;
+						that.page.page = that.page.page + 1;
+						that.list.push.apply(that.list, res.data.list);
+						uni.hideLoading()
+					},
+					err => {
+						uni.hideLoading()
+						uni.showToast({
+							title: err.msg,
+							icon: 'none',
+							duration: 2000
+						});
+					}
+				);
+			},
 			// 返回上一页
 			back() {
 				uni.navigateBack()

+ 1 - 1
pages_shopping/live/storeOrderDetail.vue

@@ -186,7 +186,7 @@
 
 						<view class="item">
 							<text class="label">运费</text>
-							<text class="text" v-if="order.payDelivery!=null">¥{{order.payDelivery.toFixed(2)}}</text>
+							<text class="text" v-if="order.payPostage!=null">¥{{order.payPostage.toFixed(2)}}</text>
 						</view>
 						<!-- <view class="item">
 							<text class="label">服务费</text>

+ 471 - 0
pages_user/user/cart.vue

@@ -0,0 +1,471 @@
+<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)">
+					<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" >{{item.newCash.toFixed(2)}}</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">{{totalMoney.toFixed(2)}}</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();
+		},
+		onShow() {
+		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) {
+			  // 保存原始数量和索引
+			  const originalNum = item.cartNum;
+			  const itemIndex = this.carts.findIndex(cart => cart.id === item.id);
+			  
+			  // 先更新本地UI(立即响应)
+			  item.cartNum = e.value;
+			  
+			  let data = { cartNum: e.value, goodsId: item.goodsId, isCart: 1 };
+			  addOrUpdateCart(data).then(
+			    res => {
+			      if (res.code == 200) {
+			        this.computedMoney();
+			      } else {
+			        // 库存不足等错误情况
+			        // 恢复原始数量
+			        this.carts[itemIndex].cartNum = originalNum;
+			        
+			        // 如果需要,可以更新库存信息
+			        if (res.data && res.data.stock) {
+			          this.carts[itemIndex].stock = res.data.stock;
+			        }
+			        
+			        // 强制刷新
+			        this.$forceUpdate();
+			        
+			        // 计算总额
+			        this.computedMoney();
+			        
+			        uni.showToast({
+			          icon: 'none',
+			          title: res.msg,
+			          duration: 2000
+			        });
+			      }
+			    },
+			    rej => {
+			      // 网络错误
+			      this.carts[itemIndex].cartNum = originalNum;
+			      this.$forceUpdate();
+			      this.computedMoney();
+			      
+			      uni.showToast({
+			        icon: 'none',
+			        title: '网络错误,请重试',
+			        duration: 2000
+			      });
+			    }
+			  );
+			},
+			// 结算
+			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/user/confirmIntegralOrder?type=cart&cartIds='+selectCarts.toString()
+				})
+			},
+			showProduct(item){
+				console.log("这个item")
+				uni.navigateTo({
+					url: '/pages_user/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: #2BC7B9;
+								line-height: 1.2;
+								margin-right: 4upx;
+							}
+							.text{
+								font-size: 32upx;
+								font-family: PingFang SC;
+								font-weight: bold;
+								color: #2BC7B9;
+								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: #2BC7B9;
+							line-height: 1.2;
+							margin-right: 10upx;
+						}
+						.num{
+							font-size: 32rpx;
+							font-family: PingFang SC;
+							font-weight: bold;
+							color: #2BC7B9;
+							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: #2BC7B9;
+					border-radius: 44upx;
+				}
+			}
+		}
+	}
+	.choose {
+		margin-right: 20rpx;
+		image{
+			width: 36rpx;
+			height: 36rpx;
+			flex-shrink: 0;
+		}
+	}
+	.empty-cart-btn {
+		border: 1rpx solid #2BC7B9;
+		color: #2BC7B9;
+		padding: 10rpx 30rpx;
+		border-radius: 40rpx;
+		margin-bottom: 20vh;
+		margin-top: 50rpx;
+		display: inline-block;
+	}
+</style>

+ 695 - 0
pages_user/user/confirmIntegralOrder.vue

@@ -0,0 +1,695 @@
+<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.province}}{{address.city}}{{address.district}}{{address.detail}}
+					</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">+{{item.newCash.toFixed(2)}}</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">{{totalIntegral}}</text>
+					</view>
+				</view>
+				<view class="item">
+					<view class="left">
+						<text class="label">我的积分:</text>
+					</view>
+					<view class="right">
+						<text class="text">{{integral}}</text>
+					</view>
+				</view>
+				<view class="item" v-if='totalMoney>0'>
+					<view class="left">
+						<text class="label">支付金额:</text>
+					</view>
+					<view class="right">
+						<text class="text">{{totalMoney.toFixed(2)}}</text>
+					</view>
+				</view>
+			</view>
+			<view class="pay-type" v-if='totalMoney>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="#2BC7B9" />
+						</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()">{{totalMoney>0?'立即支付':'立即兑换'}}</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {getAddressList} from '@/api/address'
+	import {getCartByIds,createCartOrder} 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
+			}
+		},
+		onLoad(option) {
+			this.getAddressList()
+			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
+			})
+			this.getCartByIds();
+			this.getUserInfo();
+		},
+		methods: {
+			getAddressList(){
+				uni.showLoading({
+					title:"正在加载中"
+				})
+				getAddressList().then(
+					res => {
+						uni.hideLoading()
+						if(res.code==200){
+							const defaultAddress = res.data.find(item => item.isDefault == 1);
+							        
+							        if(defaultAddress){
+							          this.address = defaultAddress;
+									  this.addressId=defaultAddress.addressId
+							          console.log('找到默认地址:', defaultAddress);
+							        } else {
+							        
+							        }
+						}else{
+							uni.showToast({
+								icon:'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+			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.totalIntegral = this.calcTotal(this.goodsList,'integral')
+							this.totalMoney = this.calcTotal(this.goodsList,'newCash')
+						}else{
+							 
+						}
+					},
+					rej => {}
+				);
+			},
+			calcTotal(cartData,type) {
+			  let total = 0;
+			
+			  cartData.forEach(item => {
+			    total += item[type] * item.cartNum;
+			  });
+			
+			  return total;
+			},
+			openAddress(){
+				uni.navigateTo({
+					url: '/pages_user/user/address'
+				})
+			},
+			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.totalMoney > 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%, #E2C99E 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: #2BC7B9;
+	 		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: #2BC7B9;
+						.gray{
+							 background-color: #ccc;
+						}
+					}
+					
+				}
+			}
+		}
+		
+	}
+</style>
+ 
+

+ 560 - 0
pages_user/user/integralGoodsDetails.vue

@@ -0,0 +1,560 @@
+<template>
+	<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="#2BC7B9"></u-badge>
+					</view>
+					<u-icon name="shopping-cart" color="#2BC7B9" size="68rpx"></u-icon>
+				</view>
+				<swiper class="swiper" :indicator-dots="false" :circular="true" :autoplay="true" :interval="3000"
+					:duration="1000" indicator-color="rgba(255, 255, 255, 0.6)" indicator-active-color="#ffffff"
+					@change="swiperChange">
+					<swiper-item class="swiper-item" v-for="(item,index) in  imgs" :key="index">
+						<image :src="item" mode="aspectFit"></image>
+					</swiper-item>
+				</swiper>
+				<!-- 数量 -->
+				<view class="num-box">{{ activeImg }}/{{ imgs.length }}</view>
+			</view>
+			<view class="integral-box">
+				<view class="title">{{items.goodsName}}</view>
+				<view class="num-box">
+					<view class="x-ac">
+						<view class="price">{{items.integral}} 积分</view>
+						<view class="price-val" v-if="items.cash>0">+{{items.cash.toFixed(2)}} 元</view>
+					</view>
+					<view class="count">价值:{{items.otPrice.toFixed(2)}}元</view>
+				</view>
+
+			</view>
+			<view class="desc-box">
+				<view class="desc" v-html="items.descs">
+				</view>
+			</view>
+		</view>
+		<view class="btn-foot">
+			<view class="p-price-box">
+				<!-- <view class="p-name">兑换积分: </view> -->
+				<view class="p-price">{{items.integral}}<text style="font-size: 20rpx;">积分</text></view>
+				<view class="p-price" v-if="items.cash > 0">+{{items.cash.toFixed(2)}}<text
+						style="font-size: 20rpx;">元</text></view>
+			</view>
+			<view class="btn-box">
+				<view class="btn add" @click="openPop">
+					加入购物车
+				</view>
+				<view class="btn buy" @click="submit()">
+					立即兑换
+				</view>
+			</view>
+		</view>
+		<u-popup :show="show" mode="bottom" closeable @close="close">
+			<view class="popbox">
+				<view class="x-f">
+					<image class="popbox-img" :src="items.imgUrl" mode="aspectFill"></image>
+					<view class="info-text">
+						<view class="price">
+							<text class="unit">¥</text>
+							<text class="num">{{items.cash.toFixed(2)}}</text>
+							<text class="oldprice"> ¥{{items.otPrice.toFixed(2)}}</text>
+						</view>
+						<view class="text es-mt-16">所需积分:{{items.integral}}</view>
+						<view class="desc-box es-mt-16">
+							<text class="text">库存:{{items.stock>0?items.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,
+		addOrUpdateCart,
+		getCartCount
+	} from '@/api/integral.js'
+	export default {
+		data() {
+			return {
+				imgs: [],
+				activeImg: 1,
+				goodsId: null,
+				items: {
+					cash: 0, 
+					otPrice: 0, 
+					integral: 0, 
+					goodsName: '', 
+					imgUrl: '',
+					stock: 0, 
+					descs: ''
+				},
+				show: false,
+				num: 1,
+				cartNum: 0
+			};
+		},
+		onLoad(option) {
+			this.goodsId = option.goodsId;
+		},
+		onShow() {
+			this.getIntegralGoodsById();
+			this.getcartNum()
+		},
+		methods: {
+			goCart() {
+				uni.navigateTo({
+					url: './cart'
+				})
+			},
+			getcartNum() {
+				getCartCount().then(res => {
+					if (res.code == 200) {
+						this.cartNum = res.data || 0
+					}
+				})
+			},
+			close() {
+				this.show = false
+			},
+			openPop() {
+				this.num = 1
+				this.show = true
+			},
+			addCart() {
+				if(this.cartNum>=this.items.stock){
+					uni.showToast({
+						title: '库存不足',
+						icon: 'none'
+					})
+					this.show = false
+					return;
+				}
+				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.utils.isLogin().then(
+					res => {
+						if (res) {
+							uni.navigateTo({
+								url: "./integralOrderPay?goodsId=" + this.goodsId
+							})
+						} else {
+							uni.navigateTo({
+								url: '/pages/auth/login'
+							})
+						}
+					}
+				);
+			},
+			swiperChange(event) {
+				this.activeImg = event.detail.current + 1
+			},
+
+			showImg() {
+				//预览图片
+				uni.previewImage({
+					urls: this.imgs,
+					current: this.imgs[0]
+				});
+			},
+			getIntegralGoodsById() {
+				let data = {
+					goodsId: this.goodsId
+				};
+				getIntegralGoodsById(data).then(
+					res => {
+						if (res.code == 200) {
+							this.items = res.data;
+							console.log("全部是", this.items)
+							if (res.data.images != null) {
+								this.imgs = res.data.images.split(",")
+							} else {
+								this.activeImg = 0;
+							}
+							console.log(this.imgs)
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+		}
+	}
+</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%;
+		display: flex;
+		flex-direction: column;
+
+		.cont-box {
+			padding-bottom: 121rpx;
+
+			.integral-box {
+				background-color: #fff;
+				padding: 20rpx;
+				width: 100%;
+				display: flex;
+				flex-direction: column;
+				align-items: flex-start;
+				justify-content: flex-start;
+
+				.title {
+					font-weight: bold;
+					font-size: 34rpx;
+					font-family: PingFang SC;
+					color: #111;
+				}
+
+				.desc {
+					margin-top: 15rpx;
+					display: flex;
+					align-items: flex-start;
+					justify-content: flex-start;
+
+					.cycle {
+						background-color: #eee;
+						border-radius: 30rpx;
+						padding: 5rpx 15rpx;
+						font-size: 26rpx;
+						font-family: PingFang SC;
+						color: #2BC7B9;
+					}
+
+					.duration {
+						margin-left: 10rpx;
+						background-color: #eee;
+						border-radius: 30rpx;
+						padding: 5rpx 15rpx;
+						font-size: 26rpx;
+						font-family: PingFang SC;
+						color: #2BC7B9;
+					}
+
+				}
+
+				.num-box {
+					margin-top: 15rpx;
+					flex: 1;
+					display: flex;
+					align-items: flex-end;
+					justify-content: space-between;
+					width: 100%;
+
+					.price {
+						padding: 5rpx 10rpx;
+						background-color: #2BC7B9;
+						border-radius: 30rpx;
+						font-size: 20rpx;
+						font-family: PingFang SC;
+						color: #ffffff;
+					}
+
+					.price-val {
+						font-weight: bold;
+						font-size: 28rpx;
+						font-family: PingFang SC;
+						color: #2BC7B9;
+					}
+
+					.count {
+						font-size: 24rpx;
+						font-family: PingFang SC;
+						color: #333333;
+					}
+
+				}
+
+
+			}
+
+			.desc-box {
+				background-color: #fff;
+				padding: 20rpx;
+				margin-top: 10rpx;
+
+				.title-box {
+					display: flex;
+					flex-direction: row;
+					align-items: center;
+					justify-content: flex-start;
+
+					.title {
+						font-size: 32rpx;
+						font-family: PingFang SC;
+						font-weight: bold;
+						color: #111111;
+					}
+
+					.line {
+						margin-right: 15rpx;
+						height: 30rpx;
+						width: 6rpx;
+						background-color: #2BC7B9;
+
+					}
+
+				}
+
+				.desc {
+					margin-top: 15rpx;
+					font-size: 28rpx;
+					font-family: PingFang SC;
+					color: #9a9a9c;
+				}
+			}
+
+		}
+	}
+
+	.btn-foot {
+		box-sizing: border-box;
+		width: 100%;
+		height: 121rpx;
+		background: #FFFFFF;
+		padding: 0 32rpx 0 28rpx;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		z-index: 99;
+
+		.p-price-box {
+			.p-name {
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #666666;
+			}
+
+			.p-price {
+				margin-left: 10rpx;
+				color: #FF6633;
+				font-size: 32rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+
+			}
+		}
+
+		.btn-box {
+			display: flex;
+			align-items: center;
+
+			.btn {
+				width: 200rpx;
+				height: 88rpx;
+				line-height: 88rpx;
+				text-align: center;
+				border-radius: 44rpx;
+				margin-left: 20rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #FFFFFF;
+
+				&:first-child {
+					margin-left: 0;
+				}
+
+				&.buy {
+					background: #2BC7B9;
+				}
+
+				&.add {
+					color: #2BC7B9 !important;
+					border: 1rpx solid #2BC7B9;
+				}
+			}
+
+		}
+	}
+
+	.goods-banner {
+		height: 756rpx;
+		background-color: #FFFFFF;
+		position: relative;
+
+		.swiper-item {
+			box-sizing: border-box;
+		}
+
+		.swiper,
+		.swiper-item,
+		.swiper-item image {
+			width: 100%;
+			height: 100%;
+		}
+
+		.num-box {
+			width: 80rpx;
+			height: 44rpx;
+			line-height: 44rpx;
+			text-align: center;
+			font-size: 24rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #FFFFFF;
+			background: rgba(0, 0, 0, .3);
+			border-radius: 22rpx;
+			position: absolute;
+			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: #2BC7B9;
+					line-height: 1.2;
+					margin-right: 10rpx;
+				}
+
+				.num {
+					font-size: 50rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #2BC7B9;
+					line-height: 1;
+				}
+			}
+
+			.text {
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 400;
+				color: #2BC7B9;
+			}
+
+			.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: #2BC7B9;
+		border-radius: 60rpx;
+		margin-top: 50rpx;
+		color: #fff;
+		padding: 20rpx 0;
+		box-sizing: border-box;
+	}
+</style>

+ 481 - 0
pages_user/user/integralGoodsList.vue

@@ -0,0 +1,481 @@
+<template>
+	<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>
+					<view class="btn-box">
+						<view class="btn" @click="loginNavTo('/pages_user/user/integralLogsList')">获得记录</view>
+						<view class="btn" style="margin-bottom: 0;" @click="loginNavTo('/pages_user/user/integralOrderList')">兑换记录</view>
+					</view>
+				</view>
+				<view class="navbox">
+					<view class="navbox-item" @click="goCart()">
+						<view class="box">
+							<u-badge type="error" max="99" :value="cartNum" bgColor="#2BC7B9"></u-badge>
+						</view>
+						<image src="/static/tabbar/cart_sel.png" mode="aspectFill"></image>
+						<text>购物车</text>
+					</view>
+					<view class="navbox-item" @click="handleOrder(0)">
+						<image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/payment.png" mode="aspectFill"></image>
+						<text>全部订单</text>
+					</view>
+					<view class="navbox-item" @click="handleOrder(1)">
+						<image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/sou_goods.png" mode="aspectFill"></image>
+						<text>待付款</text>
+					</view>
+					<view class="navbox-item" @click="handleOrder(2)">
+						<image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/send_goods.png" mode="aspectFill"></image>
+						<text>待发货</text>
+					</view>
+					<view class="navbox-item" @click="handleOrder(5)">
+						<image src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/after_sales.png" mode="aspectFill"></image>
+						<text>已取消</text>
+					</view>
+				</view>
+				<view class="tabs" v-if="tabs.length>0">
+					<u-tabs
+					 :current="tabIndex"
+					 :scrollable="true"
+					 :list="tabs"  
+					 lineColor="#2BC7B9"
+					@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/user/integralGoodsDetails?goodsId='+item.goodsId)" v-for="(item,index) in dataList">
+					<view class="top">
+						<image :src="item.imgUrl"></image>
+					</view>
+					<view class="bottom">
+						<view class="title ellipsis2">
+							{{item.goodsName}}
+						</view>
+						<view class="price-box">
+							<view class="price">{{item.integral}}积分</view>
+							<view class="price-val" v-if="item.cash > 0">+{{item.cash.toFixed(2)}}<text style="font-size: 20rpx;font-weight: normal;">元</text></view>
+							<!-- <view class="count">价值:{{item.otPrice.toFixed(2)}}元</view> -->
+						</view>
+					</view>
+				</view>
+			</view>
+			</mescroll-body>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+ import {getDictByKey} from '@/api/common.js'
+ import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+ // import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+ import {getIntegralGoodsList,getCartCount} from '@/api/integral.js'
+ import {getUserInfo} from '@/api/user'
+ export default {
+	mixins: [MescrollMixin], 
+ 	data() {
+ 		return {
+			integral:0,
+			type: null,
+			typeOptions:[],
+			tabIndex:0,
+			tabs: [],
+			mescroll:null,
+			downOption: {   //下拉刷新
+			 	use:true,
+				auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
+			},
+			upOption: {
+				onScroll:false,
+				use: true, // 是否启用上拉加载; 默认true
+				page: {
+					pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
+					size: 10 // 每页数据的数量,默认10
+				},
+				noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+				textNoMore:"已经到底了",
+				empty: {
+					icon:'https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/empty_icon.png',
+					tip: '暂无数据'
+				}
+			},
+			dataList: [],
+			top: 156,
+			cartNum: 0
+ 		}
+ 	},
+	onLoad() {
+		this.getDictByKey("sys_integral_goods_type");
+		this.utils.isLogin().then(
+			res => {
+				if(res){
+					this.getUserInfo();
+				}
+			}
+		);
+	},
+	onReady() {
+		this.getTop()
+	},
+	onShow() {
+		this.utils.isLogin().then(
+			res => {
+				if(res){
+					this.getcartNum()
+				}
+			}
+		);
+	},
+ 	methods: {
+		goCart() {
+			this.utils.isLogin().then(
+				res => {
+					if(res){
+						const url = './cart'
+						uni.navigateTo({
+							url: url
+						})
+					} else {
+						uni.navigateTo({
+							url: '/pages/auth/login'
+						})
+					}
+				}
+			);
+		},
+		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)
+				}
+			  })
+			  .exec();
+		},
+		handleOrder(current) {
+			this.utils.isLogin().then(
+				res => {
+					if(res){
+						uni.navigateTo({
+							url:'/pages_user/user/integralOrderList?current='+current
+						})
+					} else {
+						uni.navigateTo({
+							url: '/pages/auth/login'
+						})
+					}
+				}
+			);
+		},
+		getUserInfo(){
+			getUserInfo().then(
+				res => {
+					if(res.code==200){
+						if(res.user!=null){
+							this.integral=res.user.integral;
+						}
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: "请求失败",
+						});
+					}
+				},
+				rej => {}
+			);
+		},
+		loginNavTo(url){
+			this.utils.isLogin().then(
+				res => {
+					if(res){
+						uni.navigateTo({
+							url: url
+						})
+					}
+					else{
+						uni.navigateTo({
+							url:'/pages/auth/login'
+						})
+					}
+				}
+			);
+			 
+		},
+		navTo(url) {
+			uni.navigateTo({
+				url: url
+			})
+		},
+		getDictByKey(key){
+			var data={key:key}
+			var that=this;
+			getDictByKey(data).then(
+				res => {
+					if(res.code==200){
+						this.typeOptions=res.data;
+						this.typeOptions.forEach(function(item,index){
+							var data={name:item.dictLabel};
+							that.tabs.push(data);
+						})
+						this.tabs.unshift({name: '全部'})
+						if(this.tabs.length>0){
+							this.tabIndex=0
+						}
+						
+					}
+				},
+				err => {
+				}
+			);
+			
+		},
+		tabChange(item){
+			this.tabIndex = item.index
+			this.type = item.index == 0 ? null : this.typeOptions[item.index-1].dictValue;
+			this.mescroll.resetUpScroll()
+		},
+		mescrollInit(mescroll) {
+			this.mescroll = mescroll;
+		},
+		/*下拉刷新的回调 */
+		downCallback(mescroll) {
+			mescroll.resetUpScroll()
+		},
+		upCallback(page) {
+			//联网加载数据
+			var that = this;
+			var data = {
+				pageNum: page.num,
+				pageSize: page.size
+			};
+			if(this.typeOptions&&this.typeOptions.length>0) {
+				this.type = this.tabIndex == 0 ? null : this.typeOptions[this.tabIndex-1].dictValue;
+			}
+			if(this.type!=null){
+				data.goodsType=this.type
+			}
+			getIntegralGoodsList(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();
+				}
+			});
+		}
+		 
+ 	}
+ }
+ 
+ 
+</script>
+
+<style>
+	page{
+		height: 100%;
+		background-color: #f5f5f5;
+	}
+</style>
+<style scoped lang="scss">
+@mixin u-flex($flexD, $alignI, $justifyC) {
+	display: flex;
+	flex-direction: $flexD;
+	align-items: $alignI;
+	justify-content: $justifyC;
+}
+.navbox {
+	@include u-flex(row,center,space-between);
+	padding: 26rpx;
+	background: #FFFFFF;
+	border-radius: 16rpx 16rpx 16rpx 16rpx;
+	font-size: 24rpx;
+	&:last-child {
+		margin-right: 0;
+	}
+	&-item {
+		flex:1;
+		margin-right: 18rpx;
+		@include u-flex(column,center,center);
+		position: relative;
+	}
+	&-iteminfo {
+		// width: 162rpx;
+		// height: 162rpx;
+		width: 100%;
+		padding: 24rpx;
+		box-sizing: border-box;
+		background: rgba(255,255,255,0.7);
+		border-radius: 24rpx 24rpx 24rpx 24rpx;
+		@include u-flex(row,center,center);
+		font-size: 26rpx;
+		color: #222222;
+	}
+	image {
+		width: 48rpx;
+		height: 48rpx;
+		margin-bottom: 10rpx;
+	}
+	.box {
+		position: absolute;
+		top: -10rpx;
+		right: 0;
+		z-index: 99;
+	}
+}
+.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{
+				box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
+				background: linear-gradient(#2BC7B9, #a0f6ff);
+				border-radius: 30rpx;
+				display: flex;
+				align-items: flex-start;
+				justify-content: space-between;
+				padding: 30rpx;
+				margin-bottom: 24rpx;
+				.left{
+					.label{
+						font-size: 28upx;
+						font-family: PingFang SC;
+						color: #fff;
+					}
+					.integral{
+						margin-top: 30rpx;
+						font-weight: bold;
+						font-size: 40upx;
+						font-family: PingFang SC;
+						color: #fff;
+					}
+				}
+				.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: #2BC7B9;
+					}
+				}
+			}
+			.tabs{
+				height: 88rpx;
+			}
+		}
+		.integral-box{
+			padding: 30rpx;
+			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;
+				display: flex;
+				flex-direction: column;
+				align-items: flex-start;
+				justify-content: flex-start;
+				&:last-child{
+				}
+				.top{
+					width:100%;
+					height:300rpx;
+					image{
+						border-radius: 15rpx 15rpx 0rpx 0rpx;
+						width:100%;
+						height:300rpx;
+					}
+					
+				}
+				.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: #2BC7B9;
+							border-radius: 30rpx;
+							font-size: 20upx;
+							font-family: PingFang SC;
+							color: #ffffff;
+						}
+						.price-val {
+							font-size: 28rpx;
+							font-weight: bold;
+							font-family: PingFang SC;
+							color: #2BC7B9;
+						}
+						.count{
+							font-size: 24upx;
+							font-family: PingFang SC;
+							color: #333333;
+						}
+						
+					}
+				}
+			}
+		}
+	}
+}
+ 
+
+</style>

+ 174 - 0
pages_user/user/integralLogsList.vue

@@ -0,0 +1,174 @@
+<template>
+	<view class="page">
+		<view class="content">
+			<mescroll-body      ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
+			<view class="item" v-for="(item) in dataList">
+				<view class="left">
+					<text class="title"  >
+						{{utils.getDictLabel2Name(typeOptions,item.logType)}}
+					</text>
+					<view class="time">{{item.createTime}}</view>
+				</view>
+				<view class="right">
+					<text  :class="item.integral>0?'money green':'money red'">{{item.integral}}</text>
+					<text class="remark">剩余积分:{{item.balance}}</text>
+				</view>
+			</view>
+			</mescroll-body>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {getDictByKey} from '@/api/common.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
+		data() {
+			return {
+				typeOptions:[],
+				mescroll:null,
+				downOption: {
+					auto:false//不要自动加载
+				},
+				upOption: {
+					onScroll:false,
+					use: true, // 是否启用上拉加载; 默认true
+					page: {
+						num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
+						size: 10 // 每页数据的数量,默认10
+					},
+					noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+					textNoMore:"已经到底了",
+					empty: {
+						icon:'https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/empty_icon.png',
+						tip: '暂无数据'
+					}
+				},
+				dataList: []
+				 
+			}
+		},
+		onLoad() {
+			this.getDictByKey("sys_integral_log_type");
+		},
+		methods: {
+			getDictByKey(key){
+				var data={key:key}
+				getDictByKey(data).then(
+					res => {
+						if(res.code==200){
+							this.typeOptions=res.data;
+						}
+					},
+					err => {
+					}
+				);
+			},
+			mescrollInit(mescroll) {
+				this.mescroll = mescroll;
+			},
+			/*下拉刷新的回调 */
+			downCallback(mescroll) {
+				mescroll.resetUpScroll()
+			},
+			upCallback(page) {
+				//联网加载数据
+				var that = this;
+				var data = {
+					pageNum: page.num,
+					pageSize: page.size
+				};
+				// uni.showLoading({
+				// 	title:"加载中..."
+				// })
+				getUserIntegralLogsList(data).then(res => {
+					uni.hideLoading()
+					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();
+					}
+				});
+			},
+			 
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.page{
+	}
+	.content{
+		display: flex;
+		flex-direction: column;
+		.item{
+			background-color: #fff;
+			padding: 20rpx 10rpx;
+			display: flex;
+			align-items: flex-start;
+			justify-content: space-between;
+			border-top: 1rpx solid #efefef;
+			.left{
+				display: flex;
+				flex-direction: column;
+				align-items: flex-start;
+				justify-content: flex-start;
+				.title{
+					font-size: 26rpx;
+					color: #111;
+				}
+				.time{
+					margin-top: 20rpx;
+					font-size: 24rpx;
+					color: #a5a5a5;
+				}
+			}
+			.right{
+				display: flex;
+				flex-direction: column;
+				align-items: flex-end;
+				justify-content: flex-end;
+				.money{
+					font-size: 28rpx;
+					font-weight: bold;
+					color: #111;
+				}
+				.green{
+					color: green;
+				}
+				.red{
+					color:#ff0000;
+				}
+				.remark{
+					margin-top: 20rpx;
+					font-size: 24rpx;
+					color: #a5a5a5;
+					.green{
+						color: green;
+					}
+					.red{
+						color: red;
+					}
+				}
+			}
+		}
+		
+	}
+	 
+</style>

+ 601 - 0
pages_user/user/integralOrderDetails.vue

@@ -0,0 +1,601 @@
+<template>
+	<view>
+		<view class="cont">
+			<view class="bg"></view>
+			<view class="inner">			
+				<!-- 订单状态 -->
+				<view class="order-status">
+					<!-- 待付款 -->
+					<view v-if="order.status == 4" class="inner">
+						<view class="img-box">
+							<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/order_success.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://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/order_dfh.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://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/order_dfh.png" mode=""></image>
+						</view>
+						<view class="status-box">
+							<text class="status">待收货</text>
+							<text class="desc">运输中</text>
+						</view>
+					</view>
+					<!-- 已完成 -->
+					<view v-if="order.status == 3" class="inner">
+						<view class="img-box">
+							<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/order_ywc.png" mode=""></image>
+						</view>
+						<view class="status-box">
+							<text class="status">已完成</text>
+							<text class="desc">订单已确认收货,交易完成</text>
+						</view>
+					</view>
+					<!--交易取消 -->
+					<view v-if="order.status == 5" class="inner">
+						<view class="img-box">
+							<image src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/order_close.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://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/location.png" mode=""></image>
+						<view class="info">
+							<view class="name-phone">
+								<text class="text">{{order.userName}}</text>
+								<text class="text" v-if="order.userPhone!=null">{{order.userPhone}}</text>
+							</view>
+							<view class="address ellipsis2">
+								{{order.userAddress}}
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="content">
+					<view class="goods-list">
+						<view   class="item" v-for="(item,index) in list" :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.integral}}</text>
+										<text class="unit">积分</text>
+										<text class="num" v-show="item.cash>0">+{{item.cash.toFixed(2)}}</text>
+										<text class="unit" v-show="item.cash>0">元</text>
+									</view>
+									<view class="num"  >x{{item.num}}</view>
+								</view>
+							</view>
+						</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="copyOrderSn(order.orderCode)">复制</view>
+							</view>
+						</view>
+						<view class="item">
+							<text class="label">下单时间</text>
+							<text class="text">{{formattedCreateTime}}</text>
+						</view>
+					 
+						<view   class="item">
+							<text class="label">使用积分</text>
+							<text class="text"  >{{order.integral}}</text>
+						</view>
+						<view   class="item" v-if="order.deliveryName!=null">
+						 	<text class="label">物流公司</text>
+						 	<text class="text"  >{{order.deliveryName}}</text>
+						</view>
+						<view   class="item" v-if="order.deliverySn!=null">
+						 	<text class="label">物流单号</text>
+						 	<text class="text"  >{{order.deliverySn}}</text>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 按钮 -->
+		<view   class="btn-box">
+			<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 cancel">
+				联系客服
+				<button class='contact-btn' open-type="contact">
+				</button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	
+	import {getIntegralOrderById,cannelOrder} from '@/api/integral.js'
+	export default {
+		data() {
+			return {
+				orderId:null,
+				order:{},
+				list:[],
+		 
+			};
+		},
+		onLoad(option) {
+			this.orderId = option.orderId
+		},
+		onShow() {
+			this.getIntegralOrderById()
+		},
+		computed:{
+		formattedCreateTime() {
+			if (!this.order || !this.order.createTime) return '';
+			
+			// 如果是时间戳格式
+			if (typeof this.order.createTime === 'number') {
+				const date = new Date(this.order.createTime);
+				return this.formatDate(date);
+			}
+			
+			// 如果是字符串格式,尝试解析
+			const date = new Date(this.order.createTime);
+			if (!isNaN(date.getTime())) {
+				return this.formatDate(date);
+			}
+			
+			// 如果无法解析,返回原值
+			return this.order.createTime;
+		},	
+		},
+		methods: {
+			// 日期格式化方法
+			formatDate(date) {
+				const year = date.getFullYear();
+				const month = String(date.getMonth() + 1).padStart(2, '0');
+				const day = String(date.getDate()).padStart(2, '0');
+				const hours = String(date.getHours()).padStart(2, '0');
+				const minutes = String(date.getMinutes()).padStart(2, '0');
+				const seconds = String(date.getSeconds()).padStart(2, '0');
+				
+				return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+			},
+			getIntegralOrderById(){
+				var data={orderId:this.orderId};
+				getIntegralOrderById(data).then(res => {
+					if(res.code==200){
+						this.order=res.data;
+						this.list = [].concat(JSON.parse(this.order.itemJson ?? '[]')).filter(Boolean);
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: "请求失败",
+						});
+						 
+					}
+				});
+			},
+			 
+			// 复制订单编号
+			copyOrderSn(text) {
+				// 复制方法
+				uni.setClipboardData({
+					data:text,
+					success:()=>{
+						uni.showToast({
+							title:'内容已成功复制到剪切板',
+							icon:'none'
+						})
+					}
+				});
+			},
+			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>
+
+<style lang="scss">
+	.cont{
+		width: 100%;
+		position: relative;
+		.bg{
+			width: 100%;
+			height: 350upx;
+			position: absolute;
+			top: 0;
+			left: 0;
+			z-index: 1;
+			background-color: #2BC7B9;
+			background: linear-gradient(#2BC7B9, #E2C99E);
+			border-radius: 0rpx 0rpx 100rpx 100rpx;
+		}
+		.inner{
+			position: relative;
+			padding: 30upx 0rpx;
+			width: 100%;
+			height: 100%;
+			z-index: 999;
+			.order-status{
+				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;
+						}
+					}
+				}
+			}
+			.order-placer{
+				margin-top: 30upx;
+				padding: 0 20upx;
+				.inner{
+					box-sizing: border-box;
+					border-radius: 16upx;
+					height: 150upx;
+					padding: 40upx 30upx;
+					display: flex;
+					align-items: center;
+					background: #FFFFFF;
+					.location{
+						width: 24upx;
+						height: 27upx;
+						margin-right: 18upx;
+						flex-shrink: 0;
+					}
+					.info{
+						.name-phone{
+							display: flex;
+							align-items: center;
+							.text{
+								font-size: 28upx;
+								font-family: PingFang SC;
+								font-weight: bold;
+								color: #333333;
+								line-height: 1;
+								margin-right: 20upx;
+								&:last-child{
+									margin-right: 0;
+								}
+							}
+						}
+						.address{
+							font-size: 26upx;
+							font-family: PingFang SC;
+							font-weight: 500;
+							color: #999999;
+							line-height: 1.3;
+							margin-top: 10upx;
+						}
+					}
+				}
+				
+			}
+		}
+	}
+	.content{
+		margin: 20rpx 0rpx;
+		padding: 0 20upx 140rpx 20upx;
+		.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;
+					.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, #2BC7B9 0%, #E2C99E 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;
+					}
+					.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;
+				.discount{
+					font-size: 24upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+					line-height: 1;
+					margin-right: 30upx;
+				}
+				.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;
+					}
+				}
+			}
+		}
+		.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;
+					}
+				}
+				.check-box{
+					display: flex;
+					align-items: center;
+					image{
+						width: 14upx;
+						height: 24upx;
+						margin-left: 10upx;
+					}
+				}
+			}
+			.line{
+				width: 100%;
+				height: 1px;
+				background: #F0F0F0;
+				margin-top: 30upx;
+			}
+		}
+	}
+	.btn-box{
+		z-index: 999;
+		bottom: 0;
+		width: 100%;
+		position: fixed;
+		height: 120upx;
+		box-sizing: border-box;
+		background: #FFFFFF;
+		padding: 0 30upx;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+		.btn{
+			position: relative;
+			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;
+			&.cancel{
+				
+				border: 1px solid #DDDDDD;
+				color: #666666;
+			}
+			&.pay{
+				background: #2BC7B9;
+				color: #FFFFFF;
+			}
+			.contact-btn {
+				top: 0;
+				position: absolute;
+				width:100%;
+				height:100%;
+				opacity: 0;
+			}
+		}
+	}
+</style>

+ 440 - 0
pages_user/user/integralOrderList.vue

@@ -0,0 +1,440 @@
+<template>
+	<view class="content">
+		<view class="top-fixed">
+			 <u-tabs
+			:current="current"
+			  :scrollable="true"
+			  :list="tabs"  
+			  lineColor="#2BC7B9"
+			 @change="tabChange">
+			 </u-tabs>
+		</view>
+		<!-- 订单列表 -->
+		<mescroll-body  top="88rpx" bottom="0"  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" @click="showDetail(item)">
+						<view class="num">订单号:{{item.orderCode}}</view>
+						<view class="status-box">
+							<text   class="text success" v-if="item.status>1&&item.status<5">
+							{{utils.getDictLabel2Name(orderStatusOptions,item.status)}}
+							</text>
+							<text   class="text info" v-else>
+							{{utils.getDictLabel2Name(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 class="img-box">
+								<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>
+									<view class="name-box ellipsis2">
+										{{subItem.goodsName}}
+									</view>
+								</view>
+								<view class="num-box">
+									<view class="price">
+										<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"  >x{{subItem.num}}</view>
+								</view>
+							</view>
+						</view>
+						<!-- 实付金额、按钮 -->
+						<view class="bottom-box">
+							<view class="amount-paid">
+								<!-- <text class="label">使用积分:</text> -->
+								<view class="price-box">
+									<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 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 class="btn cancel">
+									联系客服
+									<button class='contact-btn' open-type="contact">
+									</button>
+								</view> -->
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</mescroll-body>
+	</view>
+</template>
+
+<script>
+ import {getDictByKey} from '@/api/common.js'
+ import {getIntegralOrderList,cannelOrder} from '@/api/integral.js'
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+ 
+ export default {
+	mixins: [MescrollMixin],
+ 	data() {
+ 		return {
+			orderStatusOptions:[],
+			searchKey:"",
+			status:"0",
+			tabs: [
+				{name:"全部",id:"0"},
+				// {name:"待支付",id:"4"},
+				{name:"待发货",id:"1"},
+				{name:"待收货",id:"2"},
+				{name:"已完成",id:"3"},
+				// {name:"已取消",id:"5"}
+			],
+			mescroll:null,
+			// 上拉加载的配置
+			upOption: {
+				onScroll:false,
+				use: true, // 是否启用上拉加载; 默认true
+				page: {
+					pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
+					size: 10 // 每页数据的数量,默认10
+				},
+				noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
+				textNoMore:"已经到底了",
+				empty: {
+					icon:'https://hdtobs.obs.cn-north-4.myhuaweicloud.com/hdt/empty_icon.png',
+					tip: '暂无数据'
+				}
+			},
+			// 列表数据
+			dataList: [],
+			current: 0
+ 		}
+ 	},
+	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}
+			getDictByKey(data).then(
+				res => {
+					if(res.code==200){
+						if(key=="sys_integral_order_status"){
+							this.orderStatusOptions=res.data;
+						}
+					}
+				},
+				err => {
+				}
+			);
+			
+		},
+		tabChange(item) {
+			this.status = item.id
+			this.mescroll.resetUpScroll()
+		},
+		mescrollInit(mescroll) {
+			this.mescroll = mescroll;
+		},
+		/*下拉刷新的回调 */
+		downCallback(mescroll) {
+			mescroll.resetUpScroll()
+		},
+		upCallback(page) {
+			//联网加载数据
+			var that = this;
+			var data = {
+				keyword:this.searchKey,
+				status:this.status,
+				pageNum: page.num,
+				pageSize: page.size
+			};
+			getIntegralOrderList(data).then(res => {
+				if(res.code==200){
+					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; 
+						
+					} 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: './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'
+					})
+				}
+			})
+		}
+ 	}
+ }
+ 
+ 
+</script>
+
+
+<style scoped lang="scss">
+	::v-deep  .u-tabs__wrapper__nav__item{
+		padding: 0 26rpx !important;
+	}
+
+
+.top-fixed{
+		width: 100%;
+		position: fixed;
+		top: 0;
+		left: 50%;
+		transform: translateX(-50%);
+		z-index: 10;
+		height: 88upx;
+		background-color: #fff;
+	}
+	.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: #2BC7B9;
+						}
+						&.black{
+							color: #111111;
+						}
+						&.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, #2BC7B9 0%, #E2C99E 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{
+							position: relative;
+							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;
+							}
+							&.pay{
+								background: #2BC7B9;
+								color: #FFFFFF;
+							}
+							.contact-btn {
+								top: 0;
+								position: absolute;
+								width:100%;
+								height:100%;
+								opacity: 0;
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+</style>

+ 781 - 0
pages_user/user/integralOrderPay.vue

@@ -0,0 +1,781 @@
+<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>
+					<!-- {{address.address}}  -->
+					<view class="address">
+						{{address.province}}{{address.city}}{{address.district}}{{address.detail}}
+					</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">
+					<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.integral}}</text>
+								<text class="unit">积分</text>
+								<text class="num" v-show="item.cash>0">+{{item.cash.toFixed(2)}}</text>
+								<text class="unit" v-show="item.cash>0">元</text>
+							</view>
+							<view class="num">x1</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">{{item.integral}}</text>
+					</view>
+				</view>
+				<view class="item">
+					<view class="left">
+						<text class="label">我的积分:</text>
+					</view>
+					<view class="right">
+						<text class="text">{{integral}}</text>
+					</view>
+				</view>
+				<view class="item" v-if='item.cash>0'>
+					<view class="left">
+						<text class="label">支付金额:</text>
+					</view>
+					<view class="right">
+						<text class="text">{{item.cash.toFixed(2)}}</text>
+					</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="#2BC7B9" />
+						</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()">{{item.cash>0?'立即支付':'立即兑换'}}</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {getAddressList} from '@/api/address'
+	import {
+		getIntegralGoodsById,
+		createOrder
+	} from '@/api/integral.js'
+	import {
+		getUserInfo
+	} from '@/api/user'
+	export default {
+		data() {
+			return {
+				addressId: null,
+				address: null,
+				orderId: null,
+				order: null,
+				item: {
+					cash: null,
+				},
+				integral: 0,
+				payTypes: [],
+				payType: '1',
+			}
+		},
+		onLoad(option) {
+			this.getAddressList()
+			this.goodsId = option.goodsId;
+			var that = this;
+			uni.$on('updateAddress', (e) => {
+				console.log("选择地址", e)
+				that.addressId = e.addressId;
+				that.address = e;
+				// that.address.address=e.province+e.city+e.district+e.detail
+			})
+			this.getIntegralGoodsById();
+			this.getUserInfo();
+		},
+		methods: {
+			getAddressList(){
+				uni.showLoading({
+					title:"正在加载中"
+				})
+				getAddressList().then(
+					res => {
+						uni.hideLoading()
+						if(res.code==200){
+							const defaultAddress = res.data.find(item => item.isDefault == 1);
+							        
+							        if(defaultAddress){
+							          this.address = defaultAddress;
+									  this.addressId=defaultAddress.addressId
+							          console.log('找到默认地址:', defaultAddress);
+							        } else {
+							          // 如果没有找到默认地址,可以选择第一个地址或者设为null
+							          // this.address = res.data.length > 0 ? res.data[0] : null;
+							          console.log('未找到默认地址,使用第一个地址或设为null');
+							        }
+						}else{
+							uni.showToast({
+								icon:'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
+			getUserInfo() {
+				getUserInfo().then(
+					res => {
+						if (res.code == 200) {
+							if (res.user != null) {
+								this.integral = res.user.integral;
+							}
+						}
+					},
+					rej => {}
+				);
+			},
+			getIntegralGoodsById() {
+				var data = {
+					goodsId: this.goodsId
+				};
+				console.log(data)
+				getIntegralGoodsById(data).then(
+					res => {
+						if (res.code == 200) {
+							this.item = res.data;
+
+						} else {
+
+						}
+					},
+					rej => {}
+				);
+			},
+			openAddress() {
+				uni.navigateTo({
+					url: '/pages_user/user/address'
+				})
+			},
+			payOrder() {
+				if (this.addressId == null) {
+					uni.showToast({
+						icon: 'none',
+						title: "请选择收货地址",
+					});
+					return;
+
+				}
+				var data = {
+					goodsId: this.goodsId,
+					addressId: this.addressId,
+				};
+				var that = this;
+				uni.showLoading();
+				createOrder(data).then(
+					res => {
+						if (res.code == 200) {
+							var temps = ['wqKEklE_w5N19w9VAGY74TltPE6Ne3BaFObDD47uDEo']
+							uni.requestSubscribeMessage({
+								tmplIds: temps,
+								success(e) {
+									setTimeout(function() {
+										if (that.item.cash > 0) {
+											uni.redirectTo({
+												url: "./integralPayment?orderId=" + res.order
+													.orderId
+											})
+										} else {
+											uni.redirectTo({
+												url: "./integralOrderPaySuccess?orderId=" + res
+													.order.orderId
+											})
+										}
+									}, 200);
+								},
+								fail(e) {
+									setTimeout(function() {
+										if (that.item.cash > 0) {
+											uni.redirectTo({
+												url: "./integralPayment?orderId=" + res.order
+													.orderId
+											})
+										} else {
+											uni.redirectTo({
+												url: "./integralOrderPaySuccess?orderId=" + res
+													.order.orderId
+											})
+										}
+									}, 200);
+								}
+							})
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.inner-box {
+		padding: 20upx 20upx 140upx;
+
+		.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, #2BC7B9 0%, #E2C99E 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: 9999;
+		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: #2BC7B9;
+			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: #2BC7B9;
+
+						.gray {
+							background-color: #ccc;
+						}
+					}
+
+				}
+			}
+		}
+
+	}
+</style>

+ 253 - 0
pages_user/user/integralOrderPaySuccess.vue

@@ -0,0 +1,253 @@
+<template>
+	<view class="content">
+		<view class="inner">
+			<view class="top">
+				<text class="title">兑换成功</text>
+				 <image class="icon" src="https://hdtobs.obs.cn-north-4.myhuaweicloud.com/miniapp/success.png" ></image>
+				 <view   class="btn-box">
+				 	<view class="btn cancel" @click="showOrderDetails(order.orderId)"> 查看订单</view>
+				 </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.integral}}</text>
+				</view>
+				<view class="item">
+					<text class="label">兑换时间</text>
+					<text class="text">{{formattedCreateTime}}</text>
+				</view>
+				 
+			</view>
+			
+		</view>
+		 
+	</view>
+</template>
+
+<script>
+	import {getIntegralOrderById} from '@/api/integral.js'
+	export default {
+		data() {
+			return {
+				order:null,
+			}
+		},
+		onLoad(option) {
+			uni.setNavigationBarTitle({
+			  title:'支付结果'
+			})
+			uni.$emit('refreshStoreOrder');
+			this.orderId=option.orderId; 
+			this.getIntegralOrderById();
+		},
+		computed:{
+		formattedCreateTime() {
+			if (!this.order || !this.order.createTime) return '';
+			
+			// 如果是时间戳格式
+			if (typeof this.order.createTime === 'number') {
+				const date = new Date(this.order.createTime);
+				return this.formatDate(date);
+			}
+			
+			// 如果是字符串格式,尝试解析
+			const date = new Date(this.order.createTime);
+			if (!isNaN(date.getTime())) {
+				return this.formatDate(date);
+			}
+			
+			// 如果无法解析,返回原值
+			return this.order.createTime;
+		},	
+		},
+		methods: {
+			// 日期格式化方法
+			formatDate(date) {
+				const year = date.getFullYear();
+				const month = String(date.getMonth() + 1).padStart(2, '0');
+				const day = String(date.getDate()).padStart(2, '0');
+				const hours = String(date.getHours()).padStart(2, '0');
+				const minutes = String(date.getMinutes()).padStart(2, '0');
+				const seconds = String(date.getSeconds()).padStart(2, '0');
+				
+				return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+			},
+			
+			getIntegralOrderById(){
+				var data = {orderId:this.orderId};
+				var that=this;
+				uni.showLoading();
+				getIntegralOrderById(data).then(
+					res => {
+						uni.hideLoading();
+						if(res.code==200){
+							that.order=res.data;
+						}else{
+							uni.showToast({
+								icon:'none',
+								title: res.msg,
+							});
+						}
+					},
+					rej => {}
+				);
+				
+			},
+			copyTest(text) {
+				// 复制方法
+				uni.setClipboardData({
+					data:text,
+					success:()=>{
+						uni.showToast({
+							title:'内容已成功复制到剪切板',
+							icon:'none'
+						})
+					}
+				});
+			},
+			showOrderDetails(orderId){
+				console.log(orderId)
+				uni.redirectTo({
+					url: "./integralOrderDetails?orderId="+orderId
+				}) 
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page{
+		height: 100%;
+	}
+	.content{
+		height: 100%;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+		.inner{
+			padding: 20upx;
+			.top{
+				box-sizing: border-box;
+				background: #FFFFFF;
+				border-radius: 16upx;
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				padding: 50upx 0upx;
+				.title{
+					font-size: 40upx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #222222;
+					line-height: 1;
+					text-align: center;
+				}
+				.icon{
+					margin: 60upx 0upx;
+					width: 100upx;
+					height: 100upx;
+				}
+				 
+			}
+			 
+			.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{
+			margin-top: 20upx;
+			box-sizing: border-box;
+			display: flex;
+			align-items: center;
+			.btn{
+				width: 155upx;
+				height: 64upx;
+				line-height: 64upx;
+				font-size: 26upx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				text-align: center;
+				border-radius: 32upx;
+				&.cancel{
+					border: 1px solid #DDDDDD;
+					color: #666666;
+				}
+				 
+			}
+		}
+	}
+	
+</style>

+ 390 - 0
pages_user/user/integralPayment.vue

@@ -0,0 +1,390 @@
+<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">{{order.payMoney.toFixed(2)}}</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,
+				};
+				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.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=="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: #2BC7B9;
+	 		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: #2BC7B9;
+			border: 1rpx solid #2BC7B9;
+			border-radius: 10upx;
+			position: relative;
+			.share-btn {
+				top:0rpx;
+				left:0rpx;
+				position: absolute;
+				width: 100%;
+				height: 88upx;
+				display: flex;
+				opacity: 0;
+			}
+		}
+	}
+	 
+</style>

BIN
static/images/points_title.png


BIN
unpackage.zip


+ 253 - 239
utils/common.js

@@ -1,43 +1,45 @@
-import {checkLogin} from '@/api/user'
+import {
+	checkLogin
+} from '@/api/user'
 import dayjs from 'dayjs'
-var isEmpty =function(obj) {
+var isEmpty = function(obj) {
 	if (typeof obj == "undefined" || obj == null || obj == "") {
 		return true;
 	} else {
 		return false;
 	}
 }
- 
-var checkToken= function() {
+
+var checkToken = function() {
 	var token = uni.getStorageSync('AppToken');
-	if (token==null||token==undefined||token=="" ) {
+	if (token == null || token == undefined || token == "") {
 		return false;
-	} 
+	}
 	return true;
 }
 
 
-var isLogin=  function() {
+var isLogin = function() {
 	return new Promise((resolve, reject) => {
 		checkLogin().then(
 			res => {
-				if(res.code==200){
+				if (res.code == 200) {
 					resolve(true);
-				}else{
+				} else {
 					resolve(false);
 				}
 			},
-			rej => { }
+			rej => {}
 		);
 	});
-	 
+
 }
 
-var checkLiveToken= function() {
+var checkLiveToken = function() {
 	var token = uni.getStorageSync('AppToken');
-	if (token==null||token==undefined||token=="" ) {
+	if (token == null || token == undefined || token == "") {
 		return false;
-	} 
+	}
 	return true;
 }
 // var isLiveLogin=  function() {
@@ -53,32 +55,46 @@ var checkLiveToken= function() {
 // 			rej => { }
 // 		);
 // 	});
-	 
+
 // }
 
-var loginOut= function() {
-	  // uni.setStorageSync('AppToken',null);
-	  // uni.setStorageSync('userInfo',null);
-	  uni.clearStorage();
+var loginOut = function() {
+	// uni.setStorageSync('AppToken',null);
+	// uni.setStorageSync('userInfo',null);
+	uni.clearStorage();
 }
-var checkLoginState= function() {
+var checkLoginState = function() {
 	var token = uni.getStorageSync('AppToken');
-	if (token ) {
+	if (token) {
 		return true
 	} else {
 		return false
 	}
 }
 
-var getDictLabelName= function(key,dictValue) {
-	if(dictValue==null){
+var getDictLabelName = function(key, dictValue) {
+	if (dictValue == null) {
 		return "";
 	}
 	var dicts = uni.getStorageSync('dicts');
-	dicts=JSON.parse(dicts);
-	var dict=dicts[key]
-	var name="";
+	dicts = JSON.parse(dicts);
+	var dict = dicts[key]
+	var name = "";
 	dict.forEach(function(item, index, array) {
+		if (dictValue.toString() == item.dictValue.toString()) {
+			name = item.dictLabel
+		}
+	});
+	return name;
+}
+
+export function getDictLabel2Name(dicts,dictValue) {
+	if(dictValue==null){
+		return "";
+	}
+	 
+	var name="";
+	dicts.forEach(function(item, index, array) {
 		 if(dictValue.toString()==item.dictValue.toString())
 		 {
 			 name=item.dictLabel
@@ -86,184 +102,184 @@ var getDictLabelName= function(key,dictValue) {
 	});
 	return name;
 }
-var getDict= function(key) {
+ 
+var getDict = function(key) {
 	var dicts = uni.getStorageSync('dicts');
-	dicts=JSON.parse(dicts);
-	var dict=dicts[key]
+	dicts = JSON.parse(dicts);
+	var dict = dicts[key]
 	return dict;
 }
 
-var subString=function(str){
+var subString = function(str) {
 	if (str.length > 4) {
-	   return str.slice(0, 4)+"...";
+		return str.slice(0, 4) + "...";
 	}
-	console.log("qxj subString:"+str);
+	console.log("qxj subString:" + str);
 	return str;
 }
 
 
-var photosToArr= function(photoUrl) {
-	 var photos=[];
-	 if(photoUrl!=null&&photoUrl!=''){
-		 photos=photoUrl.split(',');
-	 }
-	 return photos
+var photosToArr = function(photoUrl) {
+	var photos = [];
+	if (photoUrl != null && photoUrl != '') {
+		photos = photoUrl.split(',');
+	}
+	return photos
 }
 
-var dateFormat=function dateFormat(fmt, date) {
-    let ret;
-    const opt = {
-        "Y+": date.getFullYear().toString(),        // 年
-        "m+": (date.getMonth() + 1).toString(),     // 月
-        "d+": date.getDate().toString(),            // 日
-        "H+": date.getHours().toString(),           // 时
-        "M+": date.getMinutes().toString(),         // 分
-        "S+": date.getSeconds().toString()          // 秒
-        // 有其他格式化字符需求可以继续添加,必须转化成字符串
-    };
-    for (let k in opt) {
-        ret = new RegExp("(" + k + ")").exec(fmt);
-        if (ret) {
-            fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
-        };
-    };
-    return fmt;
+var dateFormat = function dateFormat(fmt, date) {
+	let ret;
+	const opt = {
+		"Y+": date.getFullYear().toString(), // 年
+		"m+": (date.getMonth() + 1).toString(), // 月
+		"d+": date.getDate().toString(), // 日
+		"H+": date.getHours().toString(), // 时
+		"M+": date.getMinutes().toString(), // 分
+		"S+": date.getSeconds().toString() // 秒
+		// 有其他格式化字符需求可以继续添加,必须转化成字符串
+	};
+	for (let k in opt) {
+		ret = new RegExp("(" + k + ")").exec(fmt);
+		if (ret) {
+			fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
+		};
+	};
+	return fmt;
 }
 
 var getProvider = service => {
-  return new Promise((resolve, reject) => {
-    // 获取当前环境的服务商
-    uni.getProvider({
-      service: service || 'oauth',
-      success: function (res) {
-        // 此处可以排除h5
-        if (res.provider) {
-          resolve(res.provider[0])
-        }
-      },
-      fail() {
-        reject('获取环境服务商失败')
-      },
-    })
-  }).catch(error => {
-    console.log('167', error)
-  })
+	return new Promise((resolve, reject) => {
+		// 获取当前环境的服务商
+		uni.getProvider({
+			service: service || 'oauth',
+			success: function(res) {
+				// 此处可以排除h5
+				if (res.provider) {
+					resolve(res.provider[0])
+				}
+			},
+			fail() {
+				reject('获取环境服务商失败')
+			},
+		})
+	}).catch(error => {
+		console.log('167', error)
+	})
 }
- 
- var handleTree=function handleTree(data, id, parentId, rootId) {
- 	id = id || 'id'
- 	parentId = parentId || 'parentId'
- 	rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
- 	//对源数据深度克隆
- 	const cloneData = JSON.parse(JSON.stringify(data))
- 	//循环所有项
- 	const treeData = cloneData.filter(father => {
- 		let branchArr = cloneData.filter(child => {
- 			//返回每一项的子级数组
- 			return father[id] === child[parentId]
- 		});
- 		branchArr.length > 0 ? father.child = branchArr : '';
- 		//返回第一层
- 		return father[parentId] === rootId;
- 	});
- 	return treeData != '' ? treeData : data;
- }
-var parsePhone=function parsePhone(mobile) {
-    var str = mobile.substr(0,3)+"****"+mobile.substr(7);
-    return str;
+
+var handleTree = function handleTree(data, id, parentId, rootId) {
+	id = id || 'id'
+	parentId = parentId || 'parentId'
+	rootId = rootId || Math.min.apply(Math, data.map(item => {
+		return item[parentId]
+	})) || 0
+	//对源数据深度克隆
+	const cloneData = JSON.parse(JSON.stringify(data))
+	//循环所有项
+	const treeData = cloneData.filter(father => {
+		let branchArr = cloneData.filter(child => {
+			//返回每一项的子级数组
+			return father[id] === child[parentId]
+		});
+		branchArr.length > 0 ? father.child = branchArr : '';
+		//返回第一层
+		return father[parentId] === rootId;
+	});
+	return treeData != '' ? treeData : data;
 }
-var parseIdCard=function parseIdCard(idCard) {
-    var str = idCard.substr(0,4)+"****"+idCard.substr(8);
-    return str;
+var parsePhone = function parsePhone(mobile) {
+	var str = mobile.substr(0, 3) + "****" + mobile.substr(7);
+	return str;
 }
- 
+var parseIdCard = function parseIdCard(idCard) {
+	var str = idCard.substr(0, 4) + "****" + idCard.substr(8);
+	return str;
+}
+
 //格式为"1990-01-01"
-var getAge=function getAge(strBirthday){       
-    var returnAge,
-   		strBirthdayArr=strBirthday.split("-"),
-    	birthYear = strBirthdayArr[0],
-    	birthMonth = strBirthdayArr[1],
-    	birthDay = strBirthdayArr[2],  
-   	 	d = new Date(),
-    	nowYear = d.getFullYear(),
-    	nowMonth = d.getMonth() + 1,
-    	nowDay = d.getDate();   
-    if(nowYear == birthYear){
-        returnAge = 0;//同年 则为0周岁
-    }
-    else{
-        var ageDiff = nowYear - birthYear ; //年之差
-        if(ageDiff > 0){
-            if(nowMonth == birthMonth) {
-                var dayDiff = nowDay - birthDay;//日之差
-                if(dayDiff < 0) {
-                    returnAge = ageDiff - 1;
-                }else {
-                    returnAge = ageDiff;
-                }
-            }else {
-                var monthDiff = nowMonth - birthMonth;//月之差
-                if(monthDiff < 0) {
-                    returnAge = ageDiff - 1;
-                }
-                else {
-                    returnAge = ageDiff ;
-                }
-            }
-        }else {
-            returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天
-        }
-    } 
-    return returnAge;//返回周岁年龄
+var getAge = function getAge(strBirthday) {
+	var returnAge,
+		strBirthdayArr = strBirthday.split("-"),
+		birthYear = strBirthdayArr[0],
+		birthMonth = strBirthdayArr[1],
+		birthDay = strBirthdayArr[2],
+		d = new Date(),
+		nowYear = d.getFullYear(),
+		nowMonth = d.getMonth() + 1,
+		nowDay = d.getDate();
+	if (nowYear == birthYear) {
+		returnAge = 0; //同年 则为0周岁
+	} else {
+		var ageDiff = nowYear - birthYear; //年之差
+		if (ageDiff > 0) {
+			if (nowMonth == birthMonth) {
+				var dayDiff = nowDay - birthDay; //日之差
+				if (dayDiff < 0) {
+					returnAge = ageDiff - 1;
+				} else {
+					returnAge = ageDiff;
+				}
+			} else {
+				var monthDiff = nowMonth - birthMonth; //月之差
+				if (monthDiff < 0) {
+					returnAge = ageDiff - 1;
+				} else {
+					returnAge = ageDiff;
+				}
+			}
+		} else {
+			returnAge = -1; //返回-1 表示出生日期输入错误 晚于今天
+		}
+	}
+	return returnAge; //返回周岁年龄
 }
 
-var clearHisSearch= function() {
- 	var searchList=[];
- 	uni.setStorageSync("hisSearch",JSON.stringify(searchList));
- }
- var getHisSearch= function() {
- 	var search = uni.getStorageSync('hisSearch');
- 	if(search!=null&&search!=undefined&&search!=""){
- 		var search=JSON.parse(search);
- 		return search;
- 	}
-	else{
-		var data=[];
+var clearHisSearch = function() {
+	var searchList = [];
+	uni.setStorageSync("hisSearch", JSON.stringify(searchList));
+}
+var getHisSearch = function() {
+	var search = uni.getStorageSync('hisSearch');
+	if (search != null && search != undefined && search != "") {
+		var search = JSON.parse(search);
+		return search;
+	} else {
+		var data = [];
 		return data;
-	} 
- 	
- }
- var addHisSearch= function(searchVal) {
- 	var search = uni.getStorageSync('hisSearch');
-	var searchList=[];
-	if(search!=null&&search!=undefined&&search!=""){
-		searchList=JSON.parse(search);
-		
+	}
+
+}
+var addHisSearch = function(searchVal) {
+	var search = uni.getStorageSync('hisSearch');
+	var searchList = [];
+	if (search != null && search != undefined && search != "") {
+		searchList = JSON.parse(search);
+
 	}
 	searchList.push(searchVal);
 	//去复
 	const uniqueArr = [...new Set(searchList)];
-	uni.setStorageSync("hisSearch",JSON.stringify(uniqueArr));
- }
+	uni.setStorageSync("hisSearch", JSON.stringify(uniqueArr));
+}
 
 
-var parseTime= function(num){//时间戳数据处理
-         let date = new Date(num*1000);
-        //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-        let y = date.getFullYear();
-        let MM = date.getMonth() + 1;
-        MM = MM < 10 ? ('0' + MM) : MM;//月补0
-        let d = date.getDate();
-        d = d < 10 ? ('0' + d) : d;//天补0
-        let h = date.getHours();
-        h = h < 10 ? ('0' + h) : h;//小时补0
-        let m = date.getMinutes();
-        m = m < 10 ? ('0' + m) : m;//分钟补0
-        let s = date.getSeconds();
-        s = s < 10 ? ('0' + s) : s;//秒补0
-        return y + '-' + MM + '-' + d + ' ' + h + ':' + m+ ':' + s;
+var parseTime = function(num) { //时间戳数据处理
+	let date = new Date(num * 1000);
+	//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+	let y = date.getFullYear();
+	let MM = date.getMonth() + 1;
+	MM = MM < 10 ? ('0' + MM) : MM; //月补0
+	let d = date.getDate();
+	d = d < 10 ? ('0' + d) : d; //天补0
+	let h = date.getHours();
+	h = h < 10 ? ('0' + h) : h; //小时补0
+	let m = date.getMinutes();
+	m = m < 10 ? ('0' + m) : m; //分钟补0
+	let s = date.getSeconds();
+	s = s < 10 ? ('0' + s) : s; //秒补0
+	return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
 
-}   
+}
 // var setData= function(obj){
 // 	 let that = this;
 // 	 let keys = [];
@@ -284,7 +300,7 @@ var parseTime= function(num){//时间戳数据处理
 // 		 })
 // 	 });
 //  }
-var setData= function(obj){
+var setData = function(obj) {
 	let that = this;
 	const handleData = (tepData, tepKey, afterKey) => {
 		var tepData2 = tepData;
@@ -334,40 +350,39 @@ var setData= function(obj){
 	});
 
 }
- const urlToObj = function(url) {
-   let obj = {}
-   let str = url.slice(url.indexOf('?') + 1)
-   let arr = str.split('&')
-   for (let j = arr.length, i = 0; i < j; i++) {
-     let arr_temp = arr[i].split('=')
-     obj[arr_temp[0]] = arr_temp[1]
-   }
-   return obj
- }
- var checkCompanyUserLoginState= function() {
- 	var token = uni.getStorageSync('CompanyUserToken');
- 	if (token ) {
- 		return true
- 	} else {
- 		return false
- 	}
- }
- 
+const urlToObj = function(url) {
+	let obj = {}
+	let str = url.slice(url.indexOf('?') + 1)
+	let arr = str.split('&')
+	for (let j = arr.length, i = 0; i < j; i++) {
+		let arr_temp = arr[i].split('=')
+		obj[arr_temp[0]] = arr_temp[1]
+	}
+	return obj
+}
+var checkCompanyUserLoginState = function() {
+	var token = uni.getStorageSync('CompanyUserToken');
+	if (token) {
+		return true
+	} else {
+		return false
+	}
+}
+
 
 /**
  * 格式化时间
  * @param {Object} 时间字符串
  */
-var formatDate=function(dateStr) {
+var formatDate = function(dateStr) {
 
-	let date = dayjs(dateStr,'YYYY-MM-DD HH:mm:ss');
+	let date = dayjs(dateStr, 'YYYY-MM-DD HH:mm:ss');
 	let today = dayjs();
 
 	let formatStr = "";
 	if (date.year() != today.year()) {
 		formatDate = date.format('YYYY-MM-DD HH:mm');
-	} 
-	else if (date.month() === today.month()) {
+	} else if (date.month() === today.month()) {
 		switch (date.date() - today.date()) {
 			case 0:
 				formatDate = date.format('今天 HH:mm');
@@ -382,11 +397,9 @@ var formatDate=function(dateStr) {
 				formatDate = date.format('MM-DD HH:mm');
 				break;
 		}
-	} 
-	else if (date.month() - today.month() === 0 && date.date() === 1) {
+	} else if (date.month() - today.month() === 0 && date.date() === 1) {
 		formatDate = date.format('明天 HH:mm');
-	} 
-	else {
+	} else {
 		formatDate = date.format('MM-DD HH:mm');
 	}
 	return formatDate;
@@ -395,7 +408,7 @@ var formatDate=function(dateStr) {
  * 随机字符串
  * 
  */
-var generateRandomString=function(length) {
+var generateRandomString = function(length) {
 	let result = '';
 	const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
 	const charactersLength = characters.length;
@@ -405,55 +418,56 @@ var generateRandomString=function(length) {
 	}
 	return result;
 }
-var isLoginCourse=function(){
+var isLoginCourse = function() {
 	return new Promise((resolve, reject) => {
 		let token = uni.getStorageSync('TOKEN_WEXIN');
-		if (token==null||token==undefined||token=="" ) {
+		if (token == null || token == undefined || token == "") {
 			resolve(false);
 		} else {
 			resolve(true);
 		}
-	}); 
+	});
 }
-var isLoginCourseqw=function(){
+var isLoginCourseqw = function() {
 	return new Promise((resolve, reject) => {
 		let token = uni.getStorageSync('TOKEN_KEYQW');
-		if (token==null||token==undefined||token=="" ) {
+		if (token == null || token == undefined || token == "") {
 			resolve(false);
 		} else {
 			resolve(true);
 		}
-	}); 
+	});
 }
 
 module.exports = {
-		isLoginCourseqw:isLoginCourseqw,
-		isLoginCourse:isLoginCourse,
-		generateRandomString:generateRandomString,
-		formatDate:formatDate,
-        isEmpty : isEmpty,
-		checkLoginState : checkLoginState,
-		getDictLabelName:getDictLabelName,
-		photosToArr:photosToArr,
-		dateFormat:dateFormat,
-		getProvider:getProvider,
-		isLogin:isLogin,
-		checkToken:checkToken,
-		loginOut:loginOut,
-		handleTree:handleTree,
-		parsePhone:parsePhone,
-		getAge:getAge,
-		parseIdCard:parseIdCard,
-		getDict:getDict,
-		addHisSearch:addHisSearch,
-		clearHisSearch:clearHisSearch,
-		getHisSearch:getHisSearch,
-		parseTime:parseTime,
-		setData:setData,
-		urlToObj:urlToObj,
-		subString:subString,
-		checkCompanyUserLoginState:checkCompanyUserLoginState,
-		checkLiveToken:checkLiveToken
-		
-		
+	isLoginCourseqw: isLoginCourseqw,
+	isLoginCourse: isLoginCourse,
+	generateRandomString: generateRandomString,
+	formatDate: formatDate,
+	isEmpty: isEmpty,
+	checkLoginState: checkLoginState,
+	getDictLabelName: getDictLabelName,
+	getDictLabel2Name:getDictLabel2Name,
+	photosToArr: photosToArr,
+	dateFormat: dateFormat,
+	getProvider: getProvider,
+	isLogin: isLogin,
+	checkToken: checkToken,
+	loginOut: loginOut,
+	handleTree: handleTree,
+	parsePhone: parsePhone,
+	getAge: getAge,
+	parseIdCard: parseIdCard,
+	getDict: getDict,
+	addHisSearch: addHisSearch,
+	clearHisSearch: clearHisSearch,
+	getHisSearch: getHisSearch,
+	parseTime: parseTime,
+	setData: setData,
+	urlToObj: urlToObj,
+	subString: subString,
+	checkCompanyUserLoginState: checkCompanyUserLoginState,
+	checkLiveToken: checkLiveToken
+
+
 };

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.