dever 4 years ago
parent
commit
8e681bcacb
6 changed files with 283 additions and 22 deletions
  1. 20 0
      pages.json
  2. 1 0
      pages/dream/index.vue
  3. 11 19
      pages/dream/view/product.vue
  4. 148 0
      pages/pay/act.vue
  5. 84 0
      pages/pay/msg.vue
  6. 19 3
      pages/user/login.vue

+ 20 - 0
pages.json

@@ -70,6 +70,26 @@
 		    		"navigationStyle": "custom"
 		    	}
 		    }
+		},
+		{
+		    "path" : "pages/pay/act",
+		    "style": {
+		    	"app-plus": {
+		    		"titleNView": false,
+		    		"bounce": "none",
+		    		"navigationStyle": "custom"
+		    	}
+		    }
+		},
+		{
+		    "path" : "pages/pay/msg",
+		    "style": {
+		    	"app-plus": {
+		    		"titleNView": false,
+		    		"bounce": "none",
+		    		"navigationStyle": "custom"
+		    	}
+		    }
 		}
     ],
 	"globalStyle": {

+ 1 - 0
pages/dream/index.vue

@@ -64,6 +64,7 @@ export default{
 	},
 	onLoad(option) {
 		this.id = option.id;
+		this.Dever.login = 'user/login?id=' + this.id;
 		this.Dever.checkLogin();
 		this.getData();
 	},

+ 11 - 19
pages/dream/view/product.vue

@@ -81,7 +81,7 @@
 						</block>
 						<view class="grace-margin-top"><text class="grace-title">购买数量</text></view>
 						<view style="margin-bottom: 40rpx;">
-							<graceNumberBox :value="buyNum" v-on:change="buyNumChange"></graceNumberBox>
+							<graceNumberBox :minNum="1" :maxNum="kuNum" :value="buyNum" v-on:change="buyNumChange"></graceNumberBox>
 						</view>
 					</scroll-view>
 					<view class="grace-product-attr-btn">
@@ -183,7 +183,7 @@ export default {
 						if (res.confirm) {
 							if (this.item.goods.type == 2 || this.item.goods.type == 4) {
 								this.copy(this.item.goods.code);
-								this.Dever.alert('已复制,请打开' + name + 'APP即可看到该商品');
+								this.Dever.alert('已复制,请打开' + name + 'APP即可购买该商品');
 							} else {
 								this.Dever.location(this.item.goods.link);
 							}
@@ -211,13 +211,9 @@ export default {
 			this.getAttrKey();
 		},
 		// 购买数量变化
-		buyNumChange : function (e) {
-			var price = this.getAttrKey();
-			if (price) {
-				console.info(this.buyNum);
-				this.buyNum = e[0];
-				this.payPrice = parseFloat(price) * this.buyNum;			
-			}
+		buyNumChange : function (e) {
+			this.buyNum = e[0];
+			this.getAttrKey();
 		},
 		// 属性提交
 		attrSubmit : function(e) {
@@ -227,13 +223,16 @@ export default {
 				icon:"none"
 			});
 			var data = {};
-			data.goods = this.item.goods.id;
+			data.goods_id = this.item.goods.id;
 			data.price = this.payPrice;
 			data.num = this.buyNum;
 			data.sku = this.skuId;
 			console.log(data);
 			//如果想关闭属性
 			//this.closeAttr();
+			this.Dever.post('app/collection/?l=pay.product', data, function(t) {
+				console.info(t);
+			});
 		},
 		// 获取属性key
 		getAttrKey : function() {
@@ -245,19 +244,12 @@ export default {
 			
 			if (this.item.goods.price_type == 1) {
 				this.kuNum = parseInt(this.item.goods.num);
-				
-				if (this.buyNum >= this.kuNum) {
-					return false;
-				}
 				this.skuId = 0;
-				return this.item.goods.price.min.price;
+				this.payPrice = parseFloat(this.item.goods.price.min.price) * this.buyNum;
 			} else if (this.item.goods.price_type == 2 && this.item.goods.price.list[this.attrKey]) {
 				this.kuNum = parseInt(this.item.goods.price.list[this.attrKey].num);
-				if (this.buyNum >= this.kuNum) {
-					return false;
-				}
 				this.skuId = this.item.goods.price.list[this.attrKey].id;
-				return this.item.goods.price.list[this.attrKey].price;
+				this.payPrice = parseFloat(this.item.goods.price.list[this.attrKey].price) * this.buyNum;
 			}
 			
 			return true;

File diff suppressed because it is too large
+ 148 - 0
pages/pay/act.vue


+ 84 - 0
pages/pay/msg.vue

@@ -0,0 +1,84 @@
+<template>
+    <view>
+        <view class="padding-xl">
+            <view class="text-center">
+                <view :class="fetch.class"></view>
+                <view class="margin-top text-xl">{{fetch.status_text}}</view>
+            </view>
+            <view class="bg-white margin-top grace-border-t grace-shadow">
+                <view class="padding grace-border-b">
+                    <view class="grace-space-between grace-flex-vcenter">
+                        <view class="text-hui text-sm">支付金额</view>
+                        <view class="text-ssblue">{{fetch.price}}</view>
+                    </view>
+                </view>
+                <view class="padding grace-border-b">
+                    <view class="grace-space-between grace-flex-vcenter">
+                        <view class="text-hui text-sm">支付方式</view>
+                        <view class="text-ssblue">{{fetch.pay_type.name}}</view>
+                    </view>
+                </view>
+                <view class="padding grace-border-b">
+                    <view class="grace-space-between grace-flex-vcenter">
+                        <view class="text-hui text-sm">订单号码</view>
+                        <view class="text-ssblue">{{fetch.order_id}}</view>
+                    </view>
+                </view>
+                <view class="padding grace-border-b">
+                    <view class="grace-space-between grace-flex-vcenter">
+                        <view class="text-hui text-sm">支付时间</view>
+                        <view class="text-ssblue">{{fetch.pay_at}}</view>
+                    </view>
+                </view>
+            </view>
+            <button type="primary" class="grace-button buttom-radius buttom-shadow margin-top-xxl" @click="toIndex">
+                {{fetch.text}}
+            </button>
+            
+        </view>
+		<pageLoading :pageLoading="pageLoading"></pageLoading>
+    </view>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {
+                fetch : {
+					status : 2,
+					status_text : '支付中',
+					pay_type : {
+						name : '',
+					},
+					pay_at : '',
+					price : '',
+					order_id : '',
+					text : '返回首页',
+					class : 'grace-icons bg-blue icon-right text-xxxl text-bold',
+				}
+            }
+        },
+		onLoad: function(option) {
+			this.code = option.code;
+		},
+		onShow:function(){
+			this.Dever.checkLogin();
+			this.getInfo();
+		},
+        methods: {
+			getInfo: function() {
+				this.Dever.get(this, 'buyMsg', {code:this.code});
+			},
+            toIndex : function () {
+                uni.switchTab({
+                    url: '/pages/index/index'
+                });
+            }
+        }
+    }
+</script>
+
+<style>
+.icon-right {border-radius: 50%;width: 100rpx;height: 100rpx;line-height: 100rpx;margin: 0 auto;}
+.grace-border-t{border-top:5px solid #3c64c9;}
+</style>

+ 19 - 3
pages/user/login.vue

@@ -49,7 +49,7 @@
 					:class="showAgree?'cuIcon-radiobox':'cuIcon-round'"
 				> 同意</text>
 				<!-- 协议地址 -->
-				<navigator url="" open-type="navigate">《{{Dever.config.system_name}}入境协议》</navigator>
+				<navigator url="" open-type="navigate">《入境协议》</navigator>
 			</view>
 			
 			<!-- 其他登录 -->
@@ -77,7 +77,9 @@
 	export default {
 		data() {
 			return {
+				id : 0,
 				system_logo : '',
+				system_name : '',
 				phoneData:'', // 用户/电话
 				passData:'', //密码
 				verCode:"", //验证码
@@ -89,11 +91,25 @@
 			wInput,
 			wButton,
 		},
-		mounted() {
+		onLoad(option) {
 			self = this;
-			this.system_logo = this.Dever.config.system_logo;
+			self.id = option.id;
+			self.getData();
 		},
 		methods: {
+			getData : function() {
+				if (self.id) {
+					self.Dever.get(self, 'app/collection/?l=api.getConfig', {id:self.id}, function(t) {
+						uni.setNavigationBarTitle({
+							title:t.info.name
+						});
+						self.system_logo = t.info.logo;
+						self.system_name = t.info.name;
+					});
+				} else {
+					self.system_logo = self.Dever.config.system_logo;
+				}
+			},
 			isShowAgree(){
 				//是否选择协议
 				self.showAgree = !self.showAgree;

Some files were not shown because too many files changed in this diff