Browse Source

积分兑换

yangchaowen 2 years ago
parent
commit
2a03428824

+ 2 - 2
main.js

@@ -3,8 +3,8 @@ import store from './store'
 import App from './App'
 
 // 后端api地址
-Vue.prototype.$unishow = "https://81f.dev.ytxxjs.cn/addons/unishop";
-// Vue.prototype.$unishow = "http://www.bj.com/addons/unishop";
+// Vue.prototype.$unishow = "https://81f.dev.ytxxjs.cn/addons/unishop";
+Vue.prototype.$unishow = "https://81fdev.dev.ytxxjs.cn/addons/unishop";
 
 // 为了方便每次上传的时候忘记修改上面的参数
 uni.getSystemInfo({

+ 17 - 10
pages/activity/detail.vue

@@ -105,23 +105,20 @@
 			</button>
 
 
-		<button class="btn2" @click="btnConfirm" >
-				活动报名
-			</button>
 			
 			
 
-	<!-- 		<button class="btn2" @click="btnConfirm" v-if="infi.activity.activity_status==1&&phone">
+			<button class="btn2" @click="btnConfirm" v-if="info.activity.activity_status==1&&phone">
 				活动报名
-			</button> -->
+			</button>
 
 
-	<!-- 		<button class="btn2"   v-if="infi.activity.activity_status==1&&!phone"   open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">
+			<button class="btn2"   v-if="info.activity.activity_status==1&&!phone"   open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">
 				活动报名
-			</button> -->
+			</button>
 
 
-			<view class="btn3" v-if="infi.activity.activity_status==0">
+			<view class="btn3" v-if="info.activity.activity_status==0">
 				活动结束
 			</view>
 
@@ -173,7 +170,9 @@
 		 */
 		,
 		onLoad: function(options) {
-			this.id = options.id || 4
+			this.id = options.id || 4;
+			this.phone = uni.getStorageSync('userInfo').mobile || ''
+			
 			this.getinfo();
 		},
 		/**
@@ -204,12 +203,20 @@
 				var that = this
 				console.log(e)
 				
-				let res = await that.$api.request('/Activity/activity_join', 'GET', {
+				let res = await that.$api.request('/User/get_phone', 'GET', {
+					access_token:uni.getStorageSync('access_token')||'',
 					code: e.detail.code
 				});
 				
 				if(res){
+					
 					this.phone = res
+					
+					var userInfo = uni.getStorageSync('userInfo');
+					
+					userInfo.mobile = phone;
+					
+					uni.setStorageSync('userInfo',userInfo)
 				}
 				
 				

+ 3 - 0
pages/address/addressManage.vue

@@ -127,6 +127,9 @@
 					this.$api.msg('请填详细地址信息');
 					return;
 				}
+				
+				
+				
 				console.log(data.is_default);
 				data.is_default = data.is_default == true ? 1 : 0;
 				let action = this.manageType == 'edit' ? 'edit' : 'add';

+ 11 - 3
pages/intergalShop/confirm.vue

@@ -317,9 +317,17 @@ export default {
 		   this.runing = false
 		   
 		   if(data){
-			uni.navigateTo({
-				url:'/pages/order/order?state=2'
-			});
+			   
+			   this.$api.msg('兑换成功');
+			   
+			   setTimeout(function(){
+					uni.redirectTo({
+						url:'/pages/intergalShop/logs'
+					});
+			   },1000)
+			   
+	
+			
 		   }
         },
 

+ 53 - 142
pages/intergalShop/logs.vue

@@ -11,8 +11,8 @@
 			</view>
 		</scroll-view>
 		<view class="content" v-if="list.length > 0">
-			<view class="lists" @tap="toPage" :data-order_id="item.id"
-				data-url="/pages/operate/order_detail/order_detail" :data-index="index" v-for="(item, index) in list"
+			<view class="lists" @tap="toPage" :data-id="item.order_id"
+				data-url="/pages/intergalShop/orderDetail"  v-for="(item, index) in list"
 				:key="index">
 				<!-- <view class="iflexC">
 			<text style="letter-spacing: 0px">订单编号:  {{item.order_no}}</text>
@@ -20,27 +20,16 @@
 			
 		</view> -->
 
-				<text class="lists-status" v-if="item.order_status == 0 && item.receive_type == 2">待发货</text>
 
-				<text class="lists-status" v-if="item.order_status == 0 && item.receive_type == 1">待核销</text>
+				<text class="lists-status" v-if="item.state == 2">待发货</text>
 
-				<text class="lists-status" v-else-if="item.order_status == 1">审核通过</text>
+				<text class="lists-status" v-else-if="item.state == 3">待收货</text>
 
-				<text class="lists-status" v-else-if="item.order_status == 2">已退款</text>
+				<text class="lists-status" v-else-if="item.state == 5">已完成</text>
 
-				<text class="lists-status" v-else-if="item.order_status == 3">拒绝退款</text>
-
-				<text class="lists-status" v-else-if="item.order_status == 4">已核销</text>
-
-				<text class="lists-status" v-else-if="item.order_status == 5">已发货</text>
-
-				<text class="lists-status" v-else-if="item.order_status == 6">已完成</text>
-
-				<text class="lists-status" v-else-if="item.order_status == 7">退款待审</text>
-
-				<view :class="'iflexC lists-content ' + (item.order_status == 6 ? 'borderNone' : '')">
-					<image class="lists-img" :src="item.goods_pic" mode="aspectFill"></image>
-					<text class="lists-title over_2">{{ item.goods_name }}</text>
+				<view class="iflexC lists-content">
+					<image class="lists-img" :src="item.products[0].image" mode="aspectFill"></image>
+					<text class="lists-title over_2">{{ item.products[0].title }}</text>
 					<!-- <view class="lists-num">
 					<view class="lists-num1">数量: 1</view>
 
@@ -49,11 +38,9 @@
 			</view> -->
 					<text class="lists-money">
 						价格:
-						<text class="red" v-if="item.pay_money != '0.00'">¥{{ item.pay_money }}+</text>
-						<text class="red">{{ item.integral }}</text>
-						{{ unit }} {{ item.sku ? '(' + item.sku + ')' : '' }}
+						<text class="red">{{ item.products[0].price }}</text>
 					</text>
-					<text class="lists-time">下单时间:{{ item.create_time }}</text>
+					<text class="lists-time">下单时间:{{ item.createtime }}</text>
 				</view>
 
 				<!-- <view class="iflexC" style="border-bottom:1px solid #eee;" wx:if="{{item.deliver_no}}">
@@ -62,15 +49,18 @@
 		</view> -->
 
 				<view class="iflex l-btns" style="flex-direction: row-reverse">
-					<button class="lists-btn btn2" @tap.stop.prevent="hexiao" :data-index="index"
-						v-if="(item.order_status == 3 && item.receive_type == 1 && !item.is_film == 1) || (item.order_status == 0 && item.receive_type == 1 && !item.is_film == 1)">
-						核销码
-					</button>
-
-					<button class="lists-btn btn2" @tap.stop.prevent="getMovie" :data-id="id"
+			
+                 <button class="lists-btn btn2"  
+						v-if="item.state == 5" @click.stop="buyNext(item.products[0].id)">再次购买</button>
+						
+						
+						
+				<button  @click.stop="confirm(item.order_id)" class="lists-btn btn2"  v-if="item.state == 3">确认收货</button>
+						
+						
+	<!-- 				<button class="lists-btn btn2" @tap.stop.prevent="getMovie" :data-id="id"
 						v-if="item.order_status == 0 && item.is_film == 1">点击领取</button>
 
-					<!-- <button class="lists-btn btn2" catchtap="confirm" data-order_id="{{item.id}}" wx:if="{{item.order_status==4}}">确认已核销</button> -->
 					<button class="lists-btn btn2" @tap.stop.prevent="confirm" :data-order_id="item.id"
 						v-if="item.order_status == 5">确认收货</button>
 
@@ -82,7 +72,9 @@
 					<button class="lists-btn btn2" v-if="item.receive_type == 2 && item.order_status == 5"
 						:data-phone="item.receiver_mobile" :data-no="item.deliver_no" @tap.stop.prevent="lookOrder">
 						查看物流
-					</button>
+					</button> -->
+					
+					
 				</view>
 			</view>
 		</view>
@@ -114,46 +106,7 @@
 
 		data() {
 			return {
-				list: [{
-						create_time: "2022-03-26 15:45:59",
-						deliver_no: "",
-						goods_id: 1520,
-						goods_name: "寒铁10件套美容工具IRON-0100 IRON-0100",
-						goods_pic: "https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/2487/f04456f1d7360742a070f36b0901e0a7.png",
-						id: 1182,
-						integral: "0.00",
-						is_deliver: 0,
-						is_film: 0,
-						order_no: "31038957705405027625933",
-						order_status: 0,
-						pay_money: "0.00",
-						pay_time: "2022-03-26 15:45:59",
-						receive_type: 2,
-						receiver_mobile: "18779615160",
-						send_comp: "",
-						sku: "中号型",
-						ssq_code: "360702",
-					},
-					{
-						create_time: "2022-03-26 15:45:41",
-						deliver_no: "",
-						goods_id: 1520,
-						goods_name: "寒铁10件套美容工具IRON-0100 IRON-0100",
-						goods_pic: "https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/2487/f04456f1d7360742a070f36b0901e0a7.png",
-						id: 1181,
-						integral: "0.00",
-						is_deliver: 0,
-						is_film: 0,
-						order_no: "31038957690909207348985",
-						order_status: 0,
-						pay_money: "0.00",
-						pay_time: "2022-03-26 15:45:42",
-						receive_type: 1,
-						receiver_mobile: "18779615160",
-						send_comp: "",
-						sku: "中号型",
-						ssq_code: "360702",
-					}
+				list: [
 
 
 				],
@@ -204,80 +157,43 @@
 			this.loaded || this.getlist();
 		},
 		methods: {
-			lookOrder(e) {
-				var phone = e.currentTarget.dataset.phone;
-				var no = e.currentTarget.dataset.no;
-				uni.navigateTo({
-					url: `/pages/other/logistics/logistics?phone=${phone}&no=${no}`
-				});
-			},
-
-	
-			getMovie(e) {
-				var id = e.currentTarget.dataset.id;
+			
+			buyNext(id) {
+			
 				uni.navigateTo({
-					url: `/pages/movie/pages/receive/index?id=${id}&channel=integral`
+					url: `/pages/intergalShop/goodsDetail?id=${id}`
 				});
 			},
 
-			hexiao(e) {
-				//点击核销弹出
-				var index = e.currentTarget.dataset.index;
-				var order_id = this.list[index].id;
-				uni.navigateTo({
-					url: '/pages/other/orderCode/orderCode?id=' + order_id + '&type=2'
-				}); //   var that = this;
-				//   wx.showLoading({
-				//     title: '加载中',
-				//   })
-				//   a.get('regionintegral/qrcode',
-				//   { uid: app.getCache('userinfo').uid, order_id: order_id},
-				//   function (res) {
-				//     if (res.code == 0) {
-				//       that.setData({
-				//         qr_img:res.info,
-				//         flag:true
-				//       })
-				//       wx.hideLoading({
-				//         complete: (res) => {},
-				//       })
-				//     }else{
-				//       a.toast(res.msg)
-				//     }
-				//   }
-				// )
-			},
-
-			close() {
 
-					this.flag=false
-
-			},
 
-			confirm(e) {
+			async confirm(id) {
 				// 确认收货
-				const that = this;
-				const order_id = e.currentTarget.dataset.order_id;
-				a.get(
-					'regionintegral/confirm', {
-						uid: app.globalData.getCache('userinfo').uid,
-						order_id: order_id
-					},
-					function(res) {
-						// const res1 = res ? JSON.parse(res.info) : ''
-						console.log(res);
-
-						if (res.code == 0) {
-							a.toast(res.msg, 'none');
-							setTimeout(function() {
-								that.initData();
-								that.getlist();
-							}, 1000);
-						} else {
-							a.toast(res.msg, 'none');
-						}
+				
+				let that = this;
+				let [error, res] = await uni.showModal({
+					title: '确认收货?'
+				});
+				if (res.confirm == true) {
+					let res = await that.$api.request('/order/received', 'GET', {
+						order_id: id,
+						type:1
+					});
+					if (res) {
+						// 已确认收货
+						that.initData()
+						that.getlist()
+						
 					}
-				);
+					return true;
+				}
+				this.$api.msg('收货失败');
+				return false;
+				
+				
+				
+
+	
 			},
 
 			navChange(e) {
@@ -324,11 +240,6 @@
 
 			toPage(e) {
 				let index = e.currentTarget.dataset.index;
-
-				if (this.list[index].order_status == 6 && this.list[index].is_film == 1) {
-					e.currentTarget.dataset.url = '/pages/movie/pages/myMovie/index';
-				}
-
 				app.globalData.toPage(e);
 			}
 		}

+ 118 - 403
pages/intergalShop/orderDetail.vue

@@ -5,79 +5,37 @@
 		<view class="content">
 			<view class="orderStatus">
 				<image :src="
-                        info.order_status == 1
-                            ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/f05de1ad262ae8a303f5b38ca2419eae.png'
-                            : info.order_status == 2
-                            ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/f05de1ad262ae8a303f5b38ca2419eae.png'
-                            : info.order_status == 3
+                        info.state == 2
                             ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/74354f7d56ad4043e279760e09307bef.png'
-                            : info.order_status == 4
-                            ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/f05de1ad262ae8a303f5b38ca2419eae.png'
-                            : info.order_status == 5
+                            : info.state == 3
                             ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/cb6d9cec19387616fa955f95d8470bc5.png'
-                            : info.order_status == 6
-                            ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/f05de1ad262ae8a303f5b38ca2419eae.png'
-                            : info.order_status == 0 && info.receive_type == 2
-                            ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/74354f7d56ad4043e279760e09307bef.png'
-                            : info.order_status == 0 && info.receive_type == 1
-                            ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/74354f7d56ad4043e279760e09307bef.png'
+                            : info.state == 5
+                            ? 'https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/f05de1ad262ae8a303f5b38ca2419eae.png'                           
                             : ''
                     "></image>
 				<view>
 					{{
-                        info.order_status == 1
-                            ? '审核通过'
-                            : info.order_status == 2
-                            ? '已退款'
-                            : info.order_status == 3
-                            ? '拒绝退款'
-                            : info.order_status == 4
-                            ? '已核销'
-                            : info.order_status == 5
-                            ? '已发货'
-                            : info.order_status == 6
-                            ? '已完成'
-                            : info.order_status == 0 && info.receive_type == 2
+                        info.state == 2
                             ? '待发货'
-                            : info.order_status == 0 && info.receive_type == 1
-                            ? '待核销'
+                            : info.state == 3
+                            ? '待收货'
+                            : info.state == 5
+                            ? '已完成'
                             : ''
                     }}
 				</view>
 			</view>
 
-			<!-- <view class="p-common iflexC">
-	<text>订单号:{{info.order_no}}</text>
-
-	<text class="p-con" wx:if="{{info.order_status==0&&info.receive_type==2}}">待发货</text>
-	<text class="p-con" wx:if="{{info.order_status==0&&info.receive_type==1}}">待核销</text>
-	<text class="p-con" wx:elif="{{info.order_status==1}}">审核通过</text>
-	<text class="p-con" wx:elif="{{info.order_status== 2}}">已退款</text>
-	<text class="p-con" wx:elif="{{info.order_status== 3}}">拒绝退款</text>
-	<text class="p-con" wx:elif="{{info.order_status== 4}}">已核销</text>
-	<text class="p-con" wx:elif="{{info.order_status== 5}}">已发货</text>
-	<text class="p-con" wx:elif="{{info.order_status== 6}}">已完成</text>
-
-</view> -->
-
-			<view class="p-common ibetween" v-if="info.receive_type == 1">
-				<text>手机号码 : {{ info.receiver_mobile }}</text>
-				<view class="hxCode" @tap="showHxcode">
-					<image mode="widthFix"
-						src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/6c8fc754eba8870fb95b18baaedff277.png">
-					</image>
-					<view>核销码</view>
-				</view>
-			</view>
 
-			<view class="p-common" v-if="info.receive_type == 2">
+
+			<view class="p-common">
 				<view class="p-list icenterY">
 					<text>手机号码</text>
-					<text class="cPhone">{{ info.receiver_mobile }}</text>
+					<text class="cPhone">{{ info.delivery.username }}{{ info.delivery.mobile }}</text>
 				</view>
 				<view class="p-list">
 					<text>收货地址</text>
-					<text class="cArea">{{ info.receiver_area }}</text>
+					<text class="cArea">{{ info.delivery.address }}</text>
 					<view class="cDetailAddress">{{ info.receiver_address }}</view>
 				</view>
 			</view>
@@ -90,44 +48,16 @@
                 </view>
             </view> -->
 
-			<view class="shopInfo bgfff" v-if="info.hexiao_center">
-				<view class="ibetween">
-					<view class="shopTop-name over_2">{{ info.hexiao_center.name }}</view>
-				</view>
 
-				<!--           <view class="shopBot ifend">
-                    <view class="flex1 iflexC">
-                        <view class="l-shopTime">时间:{{ info.hexiao_center.job_time }}</view>
-                        <view class="l-shopAddress over_1">地址:{{ info.hexiao_center.address }}</view>
-                    </view>
-
-                    <view class="iflex">
-                        <view
-                            class="shoploc iflexC aliCen"
-                            :data-address="info.hexiao_center.address"
-                            @tap="toPage"
-                            :data-url="'location:' + info.hexiao_center.lat + ', ' + info.hexiao_center.lng + ', ' + info.hexiao_center.name"
-                        >
-                            <image src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/b5d708429fd9e35f4d1c164d1147a7fb.png" mode="widthFix"></image>
-                        </view>
-                        <view class="shopSu"></view>
-                        <view class="shoploc iflexC aliCen" @tap="toPage" :data-url="'tel:' + info.hexiao_center.phone">
-                            <image src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/05d336706e46151d602e4287863b9d3a.png" mode="widthFix"></image>
-                        </view>
-                    </view>
-                </view> -->
-			</view>
-
-			<!-- <msg status="99" xmdata="{{info.hexiao_center}}" wx:if="{{info.hexiao_center.id}}" styles='margin:0rpx 0px 20rpx 0px;background:#fff;' /> -->
 
 			<view class="p-common iflex radiuBot">
-				<image class="p-goodsImg" :src="info.goods_pic"></image>
+				<image class="p-goodsImg" :src="info.products[0].image"></image>
 				<view class="p-goods">
-					<text class="p-goodsName bold">{{ info.goods_name }}</text>
-					<text class="p-goodsTips">{{ info.good_info ? info.good_info : '' }}</text>
+					<text class="p-goodsName bold">{{ info.products[0].title }}</text>
+					<!-- <text class="p-goodsTips">{{ info.good_info ? info.good_info : '' }}</text> -->
 					<view class="p-sku ibetween">
 						<!-- <text class="p-red"><text wx:if="{{info.pay_money}}">¥{{info.pay_money}} +</text> {{info.integral}}{{unit}}</text> -->
-						<text class="p-con">×1</text>
+						<text class="p-con">×{{ info.products[0].number }}</text>
 					</view>
 				</view>
 			</view>
@@ -135,36 +65,35 @@
 			<view class="p-common radiuTop">
 				<view class="ibetween p-list icenterY">
 					<text>商品价格:</text>
-					<text class="p-con">¥{{ info.pay_money ? info.pay_money : 0 }}</text>
+					<text class="p-con">¥{{ info.products[0].price }}</text>
 				</view>
 				<view class="ibetween p-list">
-					<text>商品{{ unit }}:</text>
-					<text class="p-con">{{ info.integral }} {{ unit }}</text>
+					<text>商品积分:</text>
+					<text class="p-con">{{ info.products[0].price }}积分</text>
 				</view>
 				<view class="ibetween p-list">
 					<text>运费:</text>
-					<text class="p-con">¥{{ info.freight ? info.freight : 0 }}</text>
+					<text class="p-con">¥{{ info.delivery_price  }}</text>
 				</view>
 				<view class="ibetween p-list icenterY">
 					<text>支付方式:</text>
 					<text class="p-con">
-						<text v-if="info.freight || info.pay_money">现金+</text>
-						{{ unit }}支付
+						{{ info.remark }}
 					</text>
 				</view>
 				<view class="ibetween p-list">
 					<text>实际支付:</text>
 					<text class="p-con colorActive">
 						<text class="p-red">
-							<text v-if="info.pay_money">¥{{ info.pay_money }}+</text>
-							{{ info.integral }}
+							<text v-if="info.delivery_price!='0.00'">¥{{ info.delivery_price }}+</text>
+							{{ info.products[0].price}}
 						</text>
-						{{ unit }}
+						积分
 					</text>
 				</view>
 			</view>
 
-			<view class="p-common iflex">
+			<!-- 			<view class="p-common iflex">
 				<text class="message">买家留言:</text>
 				<text>{{ info.user_mark ? info.user_mark : '暂无留言' }}</text>
 			</view>
@@ -173,92 +102,51 @@
 				<view class="p-list icenterY">
 					<text>买家评价:</text>
 					<text class="p-con">{{ info.inorder_comment ? info.inorder_comment.content : '暂无评价' }}</text>
-				</view>
-				<!-- <view class="p-list icenterY">
+				</view> -->
+			<!-- <view class="p-list icenterY">
     <text>商家回复:</text>
     <text class="p-con">{{info.reply ? info.reply : '暂无回复'}}</text>
   </view> -->
-			</view>
+  
+  
+  <view class="orderInfo">
+  	<view class="orderInfoTip">订单信息</view>
+  
+  	<view class="orderItem">
+  		<view>下单编号:</view>
+  		<view>{{ info.out_trade_no }}</view>
+  		<view @tap="copy" :data-on="info.out_trade_no">复制</view>
+  	</view>
+  
+  	<view class="orderItem">
+  		<view>下单时间:</view>
+  		<view>{{ info.createtime }}</view>
+  	</view>
+  </view>
+		</view>
 
-			<view class="orderInfo">
-				<view class="orderInfoTip">订单信息</view>
+	
 
-				<view class="orderItem">
-					<view>下单编号:</view>
-					<view>{{ info.order_no }}</view>
-					<view @tap="copy" :data-on="info.order_no">复制</view>
-				</view>
 
-				<view class="orderItem">
-					<view>下单时间:</view>
-					<view>{{ info.create_time }}</view>
-				</view>
-			</view>
-		</view>
 
 		<view class="p-footer iflex isFixed icenterY"
-			v-if="info.order_status == 0 || info.order_status == 4 || info.order_status == 6 || info.order_status == 5">
+			v-if="info.state == 3 || info.state == 5">
 			<!-- <button wx:if="{{info.integral_money}}" bindtap="backMoney">申请退款</button> -->
-			<button @tap="toPage" data-url="/yidu_tc/pages/comment/index?itype=1" :data-order_id="info.order_no"
-				class="activeBtn1" v-if="(info.order_status == 6 || info.order_status == 4) && info.is_comment == 0">
-				去评论
-			</button>
-			<!-- <button class="p-btn1" wx:if="{{!info.integral_money && info.is_deliver == 3 && info.is_comment == 1}}" style="opacity: 0.5">订单已完成</button> -->
-			<button @tap="confirm" v-if="info.receive_type == 2 && info.order_status == 5"
-				class="activeBtn1">确认收货</button>
+			
+			
 
-			<button @tap="lookOrder" v-if="info.receive_type == 2 && info.order_status == 5"
-				class="activeBtn2">查看物流</button>
+			<button @tap="confirm(id)" v-if="info.state == 3" class="activeBtn1">确认收货</button>
 
-			<button @tap="hx_btn" v-if="info.receive_type == 1 && info.order_status == 0 && info.is_hexiao"
-				class="activeBtn1">确认核销</button>
+			<button @click.stop="buyNext(info.products[0].id)" v-if="info.state == 5" class="activeBtn2">再次购买</button>
 
-			<button @tap="getMovie" v-if="info.order_status == 0 && info.is_film == 1" class="activeBtn1">立即领取</button>
 
-			<button v-if="info.order_status == 0 && info.receive_type == 2" class="activeBtn2">待发货</button>
 
-			<button v-if="info.order_status == 0 && info.receive_type == 1 && !info.is_hexiao"
-				class="activeBtn1">待核销</button>
 
-			<button v-if="info.order_status == 2">已退款</button>
-		</view>
 
-<!-- 		<imask :show="showCode" :zindex="30"> -->
-			<view class="mengban" v-if="showCode">
-				<view class="allBox">
-					<view class="boxWrap">
-						<view class="codeInfo">
-							<image :src="info.goods_pic"></image>
-							<view class="goodBoxInfo">
-								<view>{{ info.hexiao_center.name }}</view>
-								<view>{{ info.goods_name }}</view>
-							</view>
-						</view>
-
-						<view class="codeWrap">
-							<view class="code1">
-								<view></view>
-								<view>核销码</view>
-								<view></view>
-							</view>
-							<image :src="hxcode" class="hxcodeImg"></image>
-							<view class="codeTip">请把核销码出示给商家</view>
-						</view>
-					</view>
 
-					<view class="download" @tap="download">
-						<view>下载保存图片</view>
-						<image
-							src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/fb053b002967d127bde32a542c5a9794.png">
-						</image>
-					</view>
+		</view>
+
 
-					<image @tap="closeBox" class="closeBox"
-						src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/b9fd3c42c6e5116ecced6ed92864221a.png">
-					</image>
-				</view>
-			</view>
-		<!-- </imask> -->
 	</block>
 </template>
 
@@ -270,48 +158,9 @@
 		data() {
 			return {
 				info: {
-					admin_id: 0,
-					create_time: "2022-03-26 15:45:59",
-					deliver_no: "",
-					deliver_time: null,
-					freight: "0.00",
-					goods_id: 1520,
-					goods_name: "寒铁10件套美容工具IRON-0100 IRON-0100",
-					goods_pic: "https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/2487/f04456f1d7360742a070f36b0901e0a7.png",
-					hexiao_center: [],
-					id: 1182,
-					inorder_comment: null,
-					integral: "0.00",
-					is_comment: 0,
-					is_deliver: 0,
-					is_film: 0,
-					is_hexiao: false,
-					order_no: "31038957705405027625933",
-					order_status: 0,
-					pay_money: "0.00",
-					pay_time: "2022-03-26 15:45:59",
-					receive_type: 2,
-					receiver_address: "水南镇长征大道赣州商会大厦(章贡区长征大道31号)27楼",
-					receiver_area: "江西省赣州市章贡区",
-					receiver_mobile: "18779615160",
-					receiver_name: "李路根",
-					region_id: 159,
-					send_comp: "",
-					sku: "中号型",
-					ssq_code: "360702",
-					user_mark: "",
-					showCode:true
-				},
-
-				// 订单详情
-				unit: '积分',
 
-				inorder_comment: '',
-				showCode: false,
-				hxcode: '',
-				order_id: '',
-				uid: '',
-				show_login: false
+				},
+				id: '',
 			};
 		}
 		/**
@@ -319,50 +168,15 @@
 		 */
 		,
 		onLoad: function(options) {
-			// if (options.scene) {
-			//     this.setData({
-			//         order_id: options.scene
-			//     });
-			// } else {
-			//     this.setData({
-			//         order_id: options.order_id
-			//     });
-			// }
-
-			// let that = this;
-			// let td = that;
-			// let u = app.globalData.getCache('userinfo').uid;
-			// if (u) {
-			//     console.log('有uid');
-			//     that.setData({
-			//         uid: u
-			//     });
-			//     that.getInfo();
-			// } else {
-			//     that.setData({
-			//         show_login: true
-			//     });
-			// }
+
+			this.id = options.id;
+
+			this.getInfo()
+
 		},
-		/**
-		 * 生命周期函数--监听页面初次渲染完成
-		 */
-		onReady: function() {},
-		/**
-		 * 生命周期函数--监听页面显示
-		 */
+
 		onShow: function() {},
-		/**
-		 * 生命周期函数--监听页面隐藏
-		 */
-		onHide: function() {},
-		/**
-		 * 生命周期函数--监听页面卸载
-		 */
-		onUnload: function() {},
-		/**
-		 * 页面相关事件处理函数--监听用户下拉动作
-		 */
+
 		onPullDownRefresh: function() {
 			this.getInfo();
 		},
@@ -375,18 +189,44 @@
 		 */
 		onShareAppMessage: function() {},
 		methods: {
-			download() {
-				saveImgs(this.hxcode, function() {
-					console.log('保存成功');
+
+			async confirm(id) {
+				// 确认收货
+				
+				let that = this;
+				let [error, res] = await uni.showModal({
+					title: '确认收货?'
 				});
+				if (res.confirm == true) {
+					let res = await that.$api.request('/order/received', 'GET', {
+						order_id: id,
+						type:1
+					});
+					if (res) {
+						that.getInfo()
+						
+					}
+					return true;
+				}
+				this.$api.msg('收货失败');
+				return false;
+				
+				
+				
+
+	
 			},
+			
 
-			closeBox() {
-				this.setData({
-					showCode: false
+			buyNext(id) {
+
+				uni.navigateTo({
+					url: `/pages/intergalShop/goodsDetail?id=${id}`
 				});
 			},
 
+
+
 			copy(e) {
 				uni.setClipboardData({
 					data: e.currentTarget.dataset.on,
@@ -405,155 +245,29 @@
 				});
 			},
 
-			onLoginBack: function(e) {
-				var u = app.globalData.getCache('userinfo').uid;
 
-				if (u && this.show_login) {
-					this.setData({
-						uid: u,
-						show_login: false
-					});
-					this.getInfo();
-				}
-			},
 
-			getMovie() {
-				uni.navigateTo({
-					url: `/pages/movie/pages/receive/index?id=${this.order_id}&channel=integral`
-				});
-			},
 
-			hx_btn() {
-				var that = this;
-				uni.showModal({
-					title: '提示',
-					content: '确认核销?',
-
-					success(res) {
-						if (res.confirm) {
-							console.log('用户点击确定');
-							a.get(
-								'regionintegral/hexiao', {
-									uid: app.globalData.getCache('userinfo').uid,
-									order_id: that.order_id
-								},
-								function(r) {
-									if (r.code) {
-										a.alert(r.msg);
-									} else {
-										uni.showToast({
-											title: '核销成功'
-										});
-										setTimeout(function() {
-											uni.redirectTo({
-												url: '/pages/operate/logs/logs'
-											});
-										}, 1500);
-									}
-								}
-							);
-						} else {
-							if (res.cancel) {
-								console.log('用户点击取消');
-							}
-						}
-					}
-				});
-			},
 
-			confirm() {
-				// 确认收货
-				const that = this;
-				a.get(
-					'Integral/confirm_order', {
-						uid: app.globalData.getCache('userinfo').uid,
-						order_id: this.order_id
-					},
-					function(res) {
-						if (res.code == 0) {
-							uni.showToast({
-								title: '确认成功'
-							});
-							setTimeout(function() {
-								uni.redirectTo({
-									url: '/pages/operate/logs/logs'
-								});
-							}, 1500);
-						} else {
-							a.alert(res.msg);
-						}
-					}
-				);
-			},
 
-			backMoney() {
-				// 申请退款
-				var that = this;
-				a.confirm('是否确定申请退款?', function(res) {
-					a.get(
-						'', {
-							uid: app.globalData.getCache('userinfo').uid,
-							id: this.order_id
-						},
-						function(res) {
-							console.log(12122);
-						}
-					);
-				});
-			},
+			async getInfo() {
+
+
 
-			showHxcode() {
-				uni.showLoading({
-					title: '正在加载'
+				let data = await this.$api.request('/order/detail', 'GET', {
+					type: 1,
+					order_id: this.id
 				});
-				const that = this;
-				a.get(
-					'regionintegral/qrcode', {
-						uid: app.globalData.getCache('userinfo').uid,
-						order_id: this.order_id
-					},
-					function(res) {
-						uni.hideLoading();
-						that.setData({
-							hxcode: res.info,
-							showCode: true
-						});
-					}
-				);
-			},
 
-			getInfo() {
-				const that = this;
-				a.get(
-					'regionintegral/orderDetail', {
-						uid: app.globalData.getCache('userinfo').uid,
-						order_id: this.order_id
-					},
-					function(res) {
-						let data = res.info.data;
-						uni.stopPullDownRefresh();
-						console.log(data);
-						data.freight = Number(data.freight);
-						data.integral_money = Number(data.integral_money);
-						data.pay_money = Number(data.pay_money);
-						that.setData({
-							info: data
-						}); // that.getComment(data.goods_id)
-					}
-				);
+
+				console.log(data)
+
+				this.info = data;
+
+
 			},
 
-			// getComment(goods_id){
-			//   const that = this
-			//   a.get('regionintegral/comment', {
-			//     uid: app.getCache('userinfo').uid,
-			//     goods_id: goods_id
-			//   }, function (res) {
-			//     that.setData({
-			//      inorder_comment: res.info
-			//     })
-			//   })
-			// },
+
 			toPage(e) {
 				app.globalData.toPage(e);
 			}
@@ -669,7 +383,7 @@
 
 	.p-common:last-child {
 		padding: 0;
-		width: calc(100% - 72rpx);
+		/* width: calc(100% - 72rpx); */
 		margin-bottom: 0;
 	}
 
@@ -726,7 +440,7 @@
 
 	.p-common:last-child {
 		padding: 26rpx 30rpx !important;
-		width: calc(100% - 60rpx);
+		/* width: calc(100% - 60rpx); */
 		margin-bottom: 0;
 	}
 
@@ -918,14 +632,15 @@
 	}
 
 	.activeBtn1 {
-		background: linear-gradient(to right, #fda401, #fe6b05);
+		background:#FB4C6F;
 		color: #fff !important;
 		border: none;
 	}
 
 	.activeBtn2 {
-		color: #fe6b00 !important;
-		border: 1px solid #fe6b00;
+background:#FB4C6F;
+		color: #fff !important;
+		border: none;
 	}
 
 	.boxWrap {
@@ -1037,8 +752,8 @@
 		position: absolute;
 		top: 50%;
 		left: 50%;
-		transform: translate(-50%,-50%);
-		}
+		transform: translate(-50%, -50%);
+	}
 
 	.closeBox {
 		width: 50rpx;
@@ -1061,13 +776,13 @@
 		display: flex;
 		justify-content: space-between
 	}
-		
-	.mengban{
+
+	.mengban {
 		position: fixed;
 		top: 0;
 		left: 0;
 		right: 0;
 		bottom: 0;
-		background: rgba(0,0,0,0.7);
+		background: rgba(0, 0, 0, 0.7);
 	}
 </style>

+ 2 - 1
pages/order/order.vue

@@ -163,7 +163,8 @@
 				navItem.loadingType = 'loading';
 
 				let result = await this.$api.request('/order/getOrders', 'GET', {
-					type: state,
+					type:0,
+					state: state,
 					page: navItem.page,
 					pagesize: this.pageSize
 				});

+ 33 - 0
pages/user/user.vue

@@ -9,6 +9,8 @@
 				<view class="info-box">
 					<text class="username">{{userInfo.username || '游客'}}</text>
 				</view>
+				
+				<image @click="scancode" src="https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/8/24c084e0ca5dc787d10b3c281c42331a.png" class="scancode"></image>
 			</view>
 			<view class="vip-card-box">
 				<!-- <image class="card-bg" src="/static/vip-card-bg.png" mode=""></image> -->
@@ -197,6 +199,30 @@
 				this.coverTransition = 'transform 0.3s cubic-bezier(.21,1.93,.53,.64)';
 				this.coverTransform = 'translateY(0px)';
 			},
+				
+			scancode(){
+				
+				uni.showLoading({
+					title:'正在加载'
+				})
+				
+				wx.scanCode({
+					
+			
+				  success (res) {
+				    console.log(res)
+					
+					if(res.path){
+						console.log(1)
+						uni.reLaunch({
+							url:"/"+res.path
+						})
+					}
+					
+					
+				  }
+				})
+			},
 			async getUserInfo() {
 				uni.getUserProfile({
 					desc: '系统将获取你的用户信息',
@@ -461,5 +487,12 @@
 		line-height: 60rpx;
 		font-size: 14px;
 	}
+		
+	.scancode{
+			position: absolute;
+			right: 0;
+			width:48rpx;
+			height: 48rpx;
+	}
 	
 </style>