浏览代码

项目日志:12.14 订单列表

gubai 2 年之前
父节点
当前提交
56a6cfc042

+ 13 - 1
api/orders/orders.js

xqd
@@ -37,10 +37,22 @@ export function confirmOrderDetail(data){
 		data
 	)
 }
+
+//确认收货
+
+export function confirmReceipt(data){
+	return request.post(
+		`v1/order/confirmReceipt`,
+		data
+	)
+}
+
+
 export default {
  getOrderList,
  getOrderDetail,
  orderExchange,
  confirmOrder,
- confirmOrderDetail
+ confirmOrderDetail,
+ confirmReceipt
 }

+ 10 - 2
pages/goods/goods-detail/index.vue

xqd xqd xqd
@@ -96,7 +96,7 @@
 			<view class="buy-btn-right" @click="$refs.codePurchase.open()" v-if="produceType==1">
 				<text>立即购买</text>
 			</view>
-			<view v-if="produceType==2" class="buy-btn-right" @click="goIntegralOrder(product_id)">
+			<view v-if="produceType==2" class="buy-btn-right" @click="goProductChange(product_id)">
 				<text>立即兑换</text>
 			</view>
 		</view>
@@ -108,7 +108,7 @@
 				<view class="pop-price">
 					<view class="pop-price-left">
 						<image style="width: 180rpx;height: 136rpx; border-radius:12rpx ;"
-							src="http://t9.9026.com/imgs/special01.png" mode="" ></image>
+							:src="productDetail.cover_img" mode="" ></image>
 						<view class="pop-price-left-money" v-if="produceType == 1">
 							<text>¥</text>
 							<text>{{productDetail.price}}</text>
@@ -377,6 +377,14 @@
 			change1(e) {
 				this.current1 = e.detail.current;
 			},
+			
+			//积分兑换
+			goProductChange(id){
+				uni.navigateTo({
+					url:'/pages/my/integral/integralOrder?product_id='+id
+				})
+			},
+			
 			// 跳转积分兑换
 			goIntegralOrder(id){
 				this.$utils.jump({

+ 12 - 5
pages/my/integral/integral.vue

xqd xqd
@@ -80,15 +80,24 @@
 				// 积分产品列表
 				integralList:[],	
 				arr:[],
-			
 			}
 		},
 		onLoad() {
 			this.getProductList()
+			this.getInfo()
 			console.log(this.$store.getters.userInfo)
-			this.userIntegral=this.$store.getters.userInfo.integral
 		},
 		methods:{
+			
+			//用户信息
+			getInfo(){
+				this.$api.my.userInfo().then(res=>{
+					this.$store.dispatch('user/info', res.data)
+					this.userIntegral=this.$store.getters.userInfo.integral
+				})
+			},
+			
+			
 			// 获取积分产品列表
 			getProductList(){
 				this.$api.product.getProducts({
@@ -119,11 +128,9 @@
 						item.short = true
 					}
 				})
-				console.log(this.goodsList);
+
 			},
 			
-			
-			
 			// 跳转积分规则
 			gointegralRule(){
 				uni.navigateTo({

+ 13 - 14
pages/my/integral/integralOrder.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -110,7 +110,7 @@
 				<view class="chooselag">
 					<view @click="companyed(item.name,index)" class="language" 
 					v-for="(item,index) in typeSelect " :key="index"
-						:sgActive='activeIndex==index'>
+					:class="[activeIndex === index?'sgActive': ''] ">
 						<text>{{item.name}}</text>
 					</view>
 				</view>
@@ -130,9 +130,9 @@
 							style="font-size: 32rpx; color: #FF6200;line-height: 34rpx">确定</text></view>
 				</view>
 				<view class="chooselag">
-					<view@click="companyedShop(item.name,item.id,item.distanceToMe)" 
+					<view@click="companyedShop(item.name,item.id,item.distanceToMe,index)" 
 					class="language" v-for="(item,index) in hotelList" :key="index"
-						:sgActive='activeIndex2==index'>
+						:class="[activeIndex2 === index?'sgActive': ''] ">
 						<text>{{item.name}}</text>
 					</view>
 				</view>
@@ -188,7 +188,7 @@
 					// 产品ID
 					product_id: '',
 					// 产品规格ID
-					product_attr_id: 1,
+					attr:'',
 				},
 				// 配送方式
 				typeSelect: [{
@@ -345,7 +345,7 @@
 						obj.receiver = this.Data.receiver
 						obj.phone = this.Data.phone
 						obj.hotel_id = this.Data.hotel_id
-						obj.product_attr_id = this.Data.product_attr_id
+						obj.attr = this.Data.attr
 						this.$api.product.integralExchange({
 							...obj
 						}).then(res => {
@@ -368,7 +368,7 @@
 					obj.receiver = this.Data.receiver
 					obj.phone = this.Data.phone
 					obj.hotel_id = this.Data.hotel_id
-					obj.product_attr_id = this.Data.product_attr_id
+					obj.attr = this.Data.attr
 					this.$api.product.integralExchange({
 						...obj
 					}).then(res => {
@@ -394,10 +394,10 @@
 			openShop() {
 				this.$refs.shopSelected.open('bottom')
 			},
-			companyedShop(i, id, distance) {
+			companyedShop(i, id, distance,index) {
 				this.typestatus2 = i
 				this.distanceToMe1 = distance
-				// this.activeIndex = index
+				this.activeIndex2= index
 				this.Data.hotel_id = id
 			},
 			//确定按钮
@@ -426,7 +426,6 @@
 			companyed(i, index) {
 				this.typestatus1 = i
 				this.activeIndex = index
-				console.log(i, this.activeIndex)
 				if (index == 0) {
 					this.Data.express_type = 1
 				} else if (index == 1) {
@@ -538,11 +537,11 @@
 				justify-content: center;
 				padding-top: 40rpx;
 				padding-bottom: 40rpx;
-
-				&[sgActive] {
-					color: #405E49 !important;
-					font-weight: bold !important;
-				}
+			}
+			
+			.sgActive{
+				color: #FF6200 !important;
+				font-weight: bold !important;
 			}
 		}
 	}

+ 25 - 7
pages/my/myorders/orders.vue

xqd xqd xqd
@@ -57,7 +57,8 @@
 					<view class="btnitem" v-if="item.status == 1">
 						<text>兑换</text>
 					</view>
-					<view @click.stop="takeOver" class="btnitem" v-if="item.status == 3 && item.is_virtual == 0">
+					<view @click.stop="takeOver(item.id)" class="btnitem"
+						v-if="item.status == 3 && item.is_virtual == 0">
 						<text>确认收货</text>
 					</view>
 				</view>
@@ -92,7 +93,7 @@
 		data() {
 			return {
 				//核销码
-				qrcode: 12231231,//二维码内容(扫码识别后需要访问的网址)
+				qrcode: 12231231, //二维码内容(扫码识别后需要访问的网址)
 				// 搜索
 				search: '',
 				// 分段器标题
@@ -118,13 +119,30 @@
 			}
 		},
 		methods: {
-			
+
 			//确定收货
-			takeOver(){
-				console.log(1111);
+			takeOver(id) {
+				this.$api.orders.confirmReceipt({
+					order_id: id
+				}).then(res => {
+					if (res.code === 0) {
+						uni.showToast({
+							icon: "none",
+							title: '收货成功'
+						})
+						//重新拉数据
+						this.getMyOrder(o.isActive)
+					} else {
+						uni.showToast({
+							icon: "none",
+							title: res.msg
+						})
+					}
+
+				})
 			},
-			
-			
+
+
 			// 获取订单列表
 			getMyOrder(type) {
 				this.$api.orders.getOrderList({

+ 9 - 10
pages/my/prize/exchangePrize.vue

xqd xqd xqd xqd
@@ -99,7 +99,7 @@
 				</view>
 				<view class="chooselag">
 					<view @click="companyed(item.name,index)" class="language" v-for="(item,index) in typeSelect "
-						:key="index" :sgActive='activeIndex==index'>
+						:key="index" :class="[activeIndex === index?'sgActive': ''] ">
 						<text>{{item.name}}</text>
 					</view>
 				</view>
@@ -119,8 +119,8 @@
 							style="font-size: 32rpx; color: #FF6200;line-height: 34rpx">确定</text></view>
 				</view>
 				<view class="chooselag">
-					<view @click="companyedShop(item.name,item.id,item.distanceToMe)" class="language"
-						v-for="(item,index) in hotelList" :key="index" :sgActive='activeIndex2==index'>
+					<view @click="companyedShop(item.name,item.id,item.distanceToMe,index)" class="language"
+						v-for="(item,index) in hotelList" :key="index" :class="[activeIndex2 === index?'sgActive': ''] ">
 						<text>{{item.name}}</text>
 					</view>
 				</view>
@@ -354,9 +354,9 @@
 			openShop() {
 				this.$refs.shopSelected.open('bottom')
 			},
-			companyedShop(i, id, distance) {
+			companyedShop(i, id, distance,index) {
 				this.typestatus2 = i
-				// this.activeIndex = id
+				this.activeIndex2= index
 				this.distanceToMe1 = distance
 				this.Data.hotel_id = id
 			},
@@ -633,11 +633,10 @@
 				justify-content: center;
 				padding-top: 40rpx;
 				padding-bottom: 40rpx;
-
-				&[sgActive] {
-					color: #405E49 !important;
-					font-weight: bold !important;
-				}
+			}
+			.sgActive{
+				color: #FF6200 !important;
+				font-weight: bold !important;
 			}
 		}
 	}

+ 17 - 6
pages/my/setting/setting.vue

xqd xqd
@@ -32,9 +32,19 @@
 			}
 		},
 		onLoad() {
-			this.staff = this.$store.getters.staff
+			this.getInfo()
 		},
 		methods: {
+			//用户信息
+			getInfo(){
+				this.$api.my.userInfo().then(res=>{
+					this.$store.dispatch('user/info', res.data)
+					this.staff = this.$store.getters.userInfo.staff
+					console.log(this.staff );
+				})
+			},
+			
+			
 			// 跳转隐私政策
 			goPrivacy() {
 				uni.navigateTo({
@@ -57,11 +67,12 @@
 			loginOut() {
 				if (this.$store.getters.token) {
 					//记录用户曾经登录过
-					this.$store.getters.userInfo.isLoginOff = true
-					this.$store.dispatch("user/info", this.$store.getters.userInfo)
-					// this.$store.dispatch("user/token", null)
-					// uni.removeStorageSync('auth_token')
-					// uni.removeStorageSync('userInfo')
+					// this.$store.getters.userInfo.isLoginOff = true
+					// this.$store.dispatch("user/info", this.$store.getters.userInfo)
+					this.$store.dispatch("user/info", null)
+					this.$store.dispatch("user/token", null)
+					uni.removeStorageSync('auth_token')
+					uni.removeStorageSync('userInfo')
 					uni.reLaunch({
 						url:'/pages/login/login'
 					})

+ 16 - 16
utils/index.js

xqd
@@ -30,24 +30,24 @@ export function checkOS() {
 }
 
 
-const shareMessage = user => {
-  // #ifdef  MP-KUAISHOU
-  const title ="四海剧场"
-    // #endif
-    // #ifdef  MP-TOUTIAO | MP-WEIXIN
-  const title ="张四爷剧场"
-  // #endif
-  console.log('-->data', user)
-  return {
-    path: `/pages/index/index?user_id=${user.id}`,
-    title: title,
-    desc: title
-    // imageUrl: ''
-  }
-}
+// const shareMessage = user => {
+//   // #ifdef  MP-KUAISHOU
+//   const title ="四海剧场"
+//     // #endif
+//     // #ifdef  MP-TOUTIAO | MP-WEIXIN
+//   const title ="张四爷剧场"
+//   // #endif
+//   console.log('-->data', user)
+//   return {
+//     path: `/pages/index/index?user_id=${user.id}`,
+//     title: title,
+//     desc: title
+//     // imageUrl: ''
+//   }
+// }
 
 export default {
   copyText,
   checkOS,
-  shareMessage
+  // shareMessage
 }