浏览代码

1.完善帮助列表页面
2.添加产品详情接口

zizhong.wang 5 年之前
父节点
当前提交
ef60854a53
共有 3 个文件被更改,包括 47 次插入22 次删除
  1. 36 15
      pages/index/detailPage/index.vue
  2. 5 3
      pages/selfCenter/helpPage/helpDetail/index.vue
  3. 6 4
      pages/selfCenter/helpPage/index.vue

+ 36 - 15
pages/index/detailPage/index.vue

@@ -1,11 +1,11 @@
 
 <template>
 	<view class="content">
-		<image class="logo" src="/static/bed3.png"></image>
+		<image class="logo" :src="detailObj.picture"></image>
 		<view class="detail-title">
 			<text style="margin-left: 5%;
-			margin-right: 3%;">甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适中双面使用床垫</text>
-		    <text class="price-style">¥11999</text> 
+			margin-right: 3%;">{{detailObj.desc}}</text>
+		    <text class="price-style">¥{{detailObj.money}}</text> 
 		</view>
 		
 	<view class="share-box">
@@ -23,36 +23,57 @@
 	</view>
 		
 		<view class="product-title">产品详情</view>
-	   
-		<image class="logo-footer" src="/static/detail-bg2.png"></image>
+	    <view>
+			<u-parse :content="detailObj.content"></u-parse>
+		</view>
+		<!-- <image class="logo-footer" src="/static/detail-bg2.png"></image> -->
 		
 	</view>
 </template>
 
 <script>
+	var md5 = require("../../../common/md5.js");
+	import uParse from '@/components/gaoyia-parse/parse.vue'
 	export default {
+		components: {
+			uParse,
+		},
 		data() {
 			return {
-				title: 'Hello'
+				title: 'Hello',
+				detailObj:{},
 			}
 		},
 		onLoad(option) {
-            console.log(option)
+			this.getDetailInfo(option.detailId)
 		},
 		onShareAppMessage() {
-			console.log(111);
 			  return {
 			      title: '分销小助手',
-			      path:'/pages/index/index?inviteId=' + '111'
+			      path:'/pages/index/index?inviteId=' + getApp().globalData.user_id
 			    }
 		},
 		methods: {
-			goDetail(){
-				uni.navigateTo({
-					url: '/pages/index/detailPage/index',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
+			getDetailInfo(dId){
+				let that = this;
+				uni.request({
+					url: getApp().globalData.shareUrl, //需要设置为全局
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						method: 'getProductsInfo',
+						timestamp: getApp().globalData.globalTimestamp, //Date.now()
+						id: dId,
+						sign: md5('getProductsInfo' + getApp().globalData.globalTimestamp)
+					},
+					success: res => {
+						if (res.data.code === 200) {
+							that.detailObj = res.data.msg
+							console.log(res.data.msg)
+						}
+					}
 				});
 			},
 		    copyCode(){

+ 5 - 3
pages/selfCenter/helpPage/helpDetail/index.vue

@@ -2,13 +2,14 @@
 		<view>
 			<view>
 				<view class="help-content">
-					<text style="margin-right: 75%;"> 如何分销?</text>
+					<u-parse :content="helpHtmlParse"></u-parse>
+					<!-- <text style="margin-right: 75%;"> 如何分销?</text>
 					<text> 对于小程序所有授权用户,均可以进行分销推广产品以获得分销奖励</text>
 					<text> 打开小程序可以看到产品列表,您可以从产品列表中选择某个产品点击分享按钮,分享给好友,好友授权后即关联为您的直属下级</text>
 					<text> 1、本人购买过产品------可以分享直属下级的购买产品奖励-----拥有两个以上直属下级才可分享下级的下级的购买产品奖励;</text>
-				    <text> 2、本人未购买过产品-----可以分享直属下级的购买产品奖励------拥有5个以上直属下级才可以分享下级的下级的购买产品奖励</text>
+				    <text> 2、本人未购买过产品-----可以分享直属下级的购买产品奖励------拥有5个以上直属下级才可以分享下级的下级的购买产品奖励</text> -->
 				</view>
-				<!-- <u-parse :content="helpHtmlParse"></u-parse> -->
+				
 			</view>
 		</view>
 </template>
@@ -26,6 +27,7 @@
 		},
 		onLoad(options) {
 	         console.log(options.qId)
+			 this.helpHtmlParse = options.qId
 		},
 		methods: {
 		}

+ 6 - 4
pages/selfCenter/helpPage/index.vue

@@ -1,7 +1,7 @@
 <template>
 		<view class="list-box">
-		<view class="list-content" v-for="item in helpList" :key='item.id' @click="goHelpDetail(item.id)">
-			<text class="margin-left5">{{item.question}}</text>
+		<view class="list-content" v-for="item in helpList" :key='item.id' @click="goHelpDetail(item.content)">
+			<text class="margin-left5">{{item.title}}</text>
 			<view class="apply-box">
 				<text style="color: #999;visibility: hidden;">点击申请</text>
 				<image src="/static/arrow-right2.png" mode=""></image>
@@ -45,15 +45,16 @@
 	       this.getHelpList();
 		},
 		methods: {
-	     goHelpDetail(id){
+	     goHelpDetail(content){
 			 uni.navigateTo({
-			 	url: '/pages/selfCenter/helpPage/helpDetail/index?qId='+id,
+			 	url: '/pages/selfCenter/helpPage/helpDetail/index?qId='+content,
 			 	success: res => {},
 			 	fail: () => {},
 			 	complete: () => {}
 			 });
 		 },
 		 getHelpList(){
+			 let  that = this;
 			 uni.request({
 			 	url: getApp().globalData.shareUrl, //需要设置为全局
 			 	method: 'POST',
@@ -70,6 +71,7 @@
 			 	success: res => {
 			 		if (res.data.code === 200) {
 			 			console.log(res.data.msg)
+						that.helpList = res.data.msg
 			 		}
 			 	}
 			 });