yangchaowen 2 years ago
parent
commit
1eb2e23095
4 changed files with 620 additions and 736 deletions
  1. 1 2
      pages/article/index.vue
  2. 35 120
      pages/intergalShop/confirm.vue
  3. 578 614
      pages/intergalShop/logs.vue
  4. 6 0
      pages/poster/index.vue

+ 1 - 2
pages/article/index.vue

@@ -3,8 +3,7 @@
 		<view class="item" v-for="(item,index) in list" :key='index' @tap="toPage" :data-id='item.id' data-url='/pages/article/detail'>
 			<image :src="item.image" mode=""></image>
 			<view class="">
-				八十一坊标题文字描述文案内容标题文字描述
-				文案内容
+				{{item.title}}
 			</view>
 		</view>
 

+ 35 - 120
pages/intergalShop/confirm.vue

@@ -156,6 +156,7 @@ export default {
             addressData: {
               
             },
+			runing:false,
 
             show: false,
             message: '',
@@ -329,130 +330,44 @@ export default {
         //     }
         //   })
         // },
-        confirm() {
+        async confirm() {
             // 确认订单
             var that = this;
-            var info = that.info;
-
-            if (running) {
-                return;
-            }
-
-            info.address = that.address; // var shipping = info.shipping;
-
-            var receive_type = that.receive_type; //2邮寄 1核销
-
-            const pay_type = info.freight || info.price ? 2 : 1; // var new_data = { 'sku_key': this.data.sku_key,'goods_id': info.id, 'uid': app.getCache('userinfo').uid, 'receive_type': shipping, 'freight': info.freight, 'pay_type': pay_type, 'pay_money': info.price + info.freight, 'user_mark': that.data.message, 'integral': info.integral, 'good_info': info.good_info, 'goods_name': info.title, 'integral_money': info.price };
-
-            var new_data = {
-                sku_key: this.sku_key,
-                goods_id: info.id,
-                uid: app.globalData.getCache('userinfo').uid,
-                receive_type: receive_type,
-                user_mark: that.message
-            };
-
-            if (receive_type == 2) {
-                console.log(info.address);
-
-                if (info.address.phone) {
-                    new_data['receiver_mobile'] = info.address.phone;
-                } else {
-                    new_data['receiver_mobile'] = '';
-                }
-
-                new_data['receiver_area'] = info.address.province + info.address.city + info.address.district;
-                new_data['receiver_address'] = info.address.address;
-                new_data['receiver_name'] = info.address.consigner;
-
-                if (!new_data.receiver_mobile || !new_data.receiver_area || !new_data.receiver_address || !new_data.receiver_name) {
-                    a.alert('请选择收货地址');
-                    return;
-                }
-            } else {
-                if (receive_type == 1) {
-                    new_data['receiver_mobile'] = that.phone;
-
-                    if (!new_data.receiver_mobile) {
-                        a.alert('填写手机号码');
-                        return;
-                    }
-                }
-            }
-
-            running = true;
-            console.log(new_data);
-            a.post('regionintegral/createOrder', new_data, function (t) {
-                // 年前的支付流程
-                running = false;
-
-                if (t.code == 0) {
-                    if (t.info == 0) {
-                        a.success('兑换成功');
-                        setTimeout(function () {
-                            uni.reLaunch({
-                                url: '/pages/operate/logs/logs'
-                            });
-                        }, 1500);
-                    } else {
-                        that.toPay(t.info);
-                    }
-                } else {
-                    a.toast(t.msg, 'none');
-                }
-            });
-        },
-
-        toPay: function (order_id) {
-            let that = this;
-            a.get(
-                'pay/addintegralpay',
-                {
-                    order_id: order_id,
-                    order_type: 'region_integral'
-                },
-                function (t) {
-                    if (t.code == 0) {
-                        uni.requestPayment({
-                            timeStamp: t.info.timeStamp,
-                            nonceStr: t.info.nonceStr,
-                            package: t.info.package,
-                            signType: t.info.signType,
-                            paySign: t.info.paySign,
-                            success: function (res) {
-                                console.log(res);
-
-                                if (res.errMsg == 'requestPayment:ok') {
-                                    a.success('支付成功');
-                                    setTimeout(function () {
-                                        uni.reLaunch({
-                                            url: '/pages/operate/logs/logs'
-                                        });
-                                    }, 1500);
-                                } else {
-                                    a.error('支付失败!');
-                                }
-                            },
-                            fail: function (res) {
-                                getApp().globalData.yidu.msg('机不可失,不要让宝贝等太久哦');
-                            }
-                        });
-                    } else {
-                        if (t.code == 2) {
-                            a.success('支付成功');
-                            setTimeout(function () {
-                                uni.reLaunch({
-                                    url: '/pages/operate/logs/logs'
-                                });
-                            }, 1500);
-                        } else {
-                            a.alert(t.msg);
-                        }
-                    }
-                }
-            );
+			
+			var id = this.id;
+			
+			var addressId = this.addressData.id||''
+			
+			if(!addressId){
+				uni.showToast({
+				    title: '请先选择收货地址!',
+				    icon: 'none'
+				});
+				return false
+			}
+           
+		   if(this.runing){
+		   }
+		   
+		   this.runing = true
+		   
+		   let data = await this.$api.request('/order/createIntegral','POST',{
+		   	id,
+			addressId
+		   });
+		   
+		   
+		   this.runing = false
+		   
+		   console.log(data)
+		   if(data){
+				
+		   }
+		   
+		   
         },
 
+   
         selectAddress() {
             // 选择收货地址
             const that = this;

File diff suppressed because it is too large
+ 578 - 614
pages/intergalShop/logs.vue


+ 6 - 0
pages/poster/index.vue

@@ -179,6 +179,9 @@
 		height: 100%;
 		background: #ffffff;
 		border-radius: 10rpx;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
 	}
 	
 	.yinying .ul_panel ul li {
@@ -210,6 +213,9 @@
 	.yinying .ul_panel ul li text {
 		display: block;
 		text-align: center;
+		color: #999;
+		font-size: 28rpx;
+		margin-top: 8rpx;
 	}
 	
 	.yinying .cannel .main {