Bladeren bron

feat-添加购买协议界面

hejie 3 jaren geleden
bovenliggende
commit
a22241e0b5
3 gewijzigde bestanden met toevoegingen van 83 en 24 verwijderingen
  1. 6 0
      src/pages.json
  2. 49 0
      src/pages/pay-agreement/index.vue
  3. 28 24
      src/pages/product/p_details.vue

+ 6 - 0
src/pages.json

@@ -228,6 +228,12 @@
 			"style": {
 				"navigationBarTitleText": "积分专区"
 			}
+		},
+		{
+			"path": "pages/pay-agreement/index",
+			"style": {
+				"navigationBarTitleText": "购买协议"
+			}
 		}
 	],
 	"tabBar": {

+ 49 - 0
src/pages/pay-agreement/index.vue

@@ -0,0 +1,49 @@
+<template>
+	<view class="container">
+		<!-- 用户须知 -->
+		<jyf-parser :html="content" class="mar_t50"></jyf-parser>
+		<!-- 用户须知-end -->
+	</view>
+</template>
+
+<script>
+let app=getApp();
+// let reqApi = new ReqApi();
+var appEv = app.$vm.$options;
+import { post } from "@/request/api.js";
+import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
+// import { ReqApi } from "@/utils/reqTools.js";
+	export default {
+		data() {
+			return {
+				content:''
+			};
+		},
+		onLoad(){
+			this.loadData()
+		},
+		methods:{
+			loadData(){
+				let data = {
+					type:5
+				}
+				post("/my/article",data).then(res => {
+				  if (res.code == 0) {
+				    this.content = res.data.data.content
+					console.log(this.content)
+				    // this.BannerImg = res.list;
+				  }
+				}); 
+			}
+		},
+		components:{
+					jyfParser
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+// 用户须知
+.container{border-top: 20rpx solid #f5f5f5;padding: 0 20rpx;box-sizing: border-box;}
+// 用户须知-end
+</style>

+ 28 - 24
src/pages/product/p_details.vue

@@ -255,16 +255,16 @@ export default {
         appEv.errTips("请阅读并同意购买协议");
         return;
       }
-	  this.toPayOrder();
-    //   if (this.btnIndex == 0) {
-    //     // if(this.type != 1){
-    //     this.toPayOrder();
-    //     // }else{
-    //     // 	this.SetCartGoodsList()
-    //     // }
-    //   } else {
-    //     this.toPayOrder();
-    //   }
+      this.toPayOrder();
+      //   if (this.btnIndex == 0) {
+      //     // if(this.type != 1){
+      //     this.toPayOrder();
+      //     // }else{
+      //     // 	this.SetCartGoodsList()
+      //     // }
+      //   } else {
+      //     this.toPayOrder();
+      //   }
     },
     // 创建购买订单
     toPayOrder: function () {
@@ -325,20 +325,24 @@ export default {
     closeBtn: function () {
       this.$refs.shopping.close();
     },
-    getProPage: function () {
-      if (this.type == 1 || this.type == 2) {
-        uni.navigateTo({
-          url: "/pages/protocol/index?type=" + this.type,
-        });
-      } else if (this.type == 4) {
-        uni.navigateTo({
-          url: "/pages/protocol/index?type=" + 3,
-        });
-      } else if (this.type == 3) {
-        uni.navigateTo({
-          url: "/pages/protocol/index?type=" + 5,
-        });
-      }
+    getProPage() {
+      // if (this.type == 1 || this.type == 2) {
+      //   uni.navigateTo({
+      //     url: "/pages/protocol/index?type=" + this.type,
+      //   });
+      // } else if (this.type == 4) {
+      //   uni.navigateTo({
+      //     url: "/pages/protocol/index?type=" + 3,
+      //   });
+      // } else if (this.type == 3) {
+      //   uni.navigateTo({
+      //     url: "/pages/protocol/index?type=" + 5,
+      //   });
+      // }
+      console.log("aaaaaaaaaa");
+      uni.navigateTo({
+        url: "/pages/pay-agreement/index",
+      });
     },
   },
   onShareAppMessage: function () {