From cc6247528b559cf6a9468591bb889bb58dc14199 Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期二, 01 八月 2023 16:10:55 +0800
Subject: [PATCH] no message

---
 h5/apph5/request/api.js                 |    1 
 application/api/logic/ActivityInfo.php  |   10 +
 application/common.php                  |   19 ++
 h5/apph5/pages/wxkf/index.vue           |  108 ++++++++++++--
 h5/apph5/components/items/LineItem.vue  |  206 +++++++++++++++++++++++++++++
 application/api/controller/Activity.php |   18 ++
 h5/apph5/pages.json                     |    2 
 7 files changed, 342 insertions(+), 22 deletions(-)

diff --git a/application/api/controller/Activity.php b/application/api/controller/Activity.php
index a39bc4a..bb56ac7 100644
--- a/application/api/controller/Activity.php
+++ b/application/api/controller/Activity.php
@@ -13,7 +13,7 @@
 header("Access-Control-Allow-Origin:*");
 class Activity extends Api
 {
-    protected $noNeedLogin = ['fqb_plat_cate','run_countRecruitAct','test'];
+    protected $noNeedLogin = ['recordItemClick','fqb_plat_cate','run_countRecruitAct','test'];
     protected $noNeedRight = '*';
     /**
      * 鑾峰彇鐤姠姒�
@@ -292,5 +292,21 @@
         $this->success('鑾峰彇鎴愬姛',['haspop'=>false]);
     }
 
+    /**
+     * 
+     * 璁板綍鍟嗗搧鐐瑰嚮
+     */
+
+    public function recordItemClick()
+    {
+        $goodsid=request()->param('goodsid');
+        $plat=request()->param('plat');
+        $title=request()->param('title');
+        $act_price=request()->param('act_price');
+        $actInfo=new ActInfo();
+        $actInfo->recordItemClick($goodsid,$plat,$title,$act_price);
+        $this->success('鎴愬姛',['success'=>true]);
+    }
+
     
 }
\ No newline at end of file
diff --git a/application/api/logic/ActivityInfo.php b/application/api/logic/ActivityInfo.php
index b09270d..050b2e1 100644
--- a/application/api/logic/ActivityInfo.php
+++ b/application/api/logic/ActivityInfo.php
@@ -75,6 +75,8 @@
         return true;
     }
 
+   
+
     /**
      * 鏇存柊鑾峰彇宸查個璇蜂汉鏁�
      */
@@ -274,4 +276,12 @@
         return false;
     }
 
+    /***
+     * 璁板綍鍟嗗搧鐐瑰嚮
+     */
+    public function recordItemClick($goodsid,$plat,$title,$act_price)
+    {
+        $inser=Db::execute('insert into t_wxitems (id,create_time,goodsid,plat,title,act_price) values(?,?,?,?,?,?)',[guid(),date("Y-m-d H:i:s",  time()),$goodsid,$plat,$title,$act_price]);
+        return true;
+    }
 }
\ No newline at end of file
diff --git a/application/common.php b/application/common.php
index 4b40bc2..366e57d 100644
--- a/application/common.php
+++ b/application/common.php
@@ -516,7 +516,26 @@
         return $icon;
     }
 }
+ function guid()
+{
 
+    if (function_exists('com_create_guid')) {
+
+        return com_create_guid();
+
+    } else {
+
+        mt_srand((double)microtime() * 10000);
+        $charid = strtoupper(md5(uniqid(rand(), true)));
+        $uuid = substr($charid, 0, 8)
+            . substr($charid, 8, 4)
+            . substr($charid, 12, 4)
+            . substr($charid, 16, 4)
+            . substr($charid, 20, 12);
+        return $uuid;
+
+    }
+}
 
 function create_guid() { 
     return time().mt_rand(10000,99999);
diff --git a/h5/apph5/components/items/LineItem.vue b/h5/apph5/components/items/LineItem.vue
new file mode 100644
index 0000000..ac425ca
--- /dev/null
+++ b/h5/apph5/components/items/LineItem.vue
@@ -0,0 +1,206 @@
+<template>
+	<view class="item-v" @click="getShareLink(items)">
+		<view class="item-img">
+			<image :src="items.mainPic">
+			</image>
+		</view>
+		<view class="item-txt">
+			<view style="display: flex;">
+				<image :src="items.labelImg"></image>
+				<view class="item-txt-title">{{items.title}}</view>
+			</view>
+			<view class="item-coupon">
+				<view class="cop-con">
+					<view class="cop-txt">鍒�</view>
+					<view class="cop-money">楼{{items.couponPrice}}</view>
+				</view>
+			</view>
+			<view class="item-bottom">
+				<view class="item-price">
+					<view>鍒稿悗浠�<span class="item-price-prc">楼{{items.actualPrice}}</span></view>
+					<view style="text-decoration: line-through;">鍘熶环:{{items.originalPrice}}</view>
+				</view>
+
+				<view class="item-copy">澶嶅埗閾炬帴</view>
+
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			items: Object,
+			isrecord: {
+				type: Boolean,
+				default: false
+			},
+		},
+		created() {},
+		methods: {
+			oncopy(txt) {
+				let copyObj = {
+					data: txt,
+					success: function() {
+						uni.showToast({
+							title: '浼樻儬閾炬帴宸插鍒讹紝鐜板湪鎵撳紑鎵嬫満娣樺疂锛岄鍙栦紭鎯犲埜鍚',
+							icon: 'none',
+							duration: 2500
+						});
+					},
+					fail: function(e) {
+						console.log(e);
+					}
+				};
+				uni.setClipboardData(copyObj);
+			},
+			getShareLink(items) {
+				if(this.isrecord)
+				{//璁板綍鐐瑰嚮
+					this.recordClick(items.goodsId,items.sourceType,items.dtitle,items.actualPrice);
+				}
+				var goodsid=items.goodsId;
+				var that = this;
+				let postdata = {
+					goodsId: goodsid
+				};
+				uni.showLoading({
+					title: '澶嶅埗涓�..',
+					mask: true
+				});
+				this.$http.post('/api/taoke/get_privilege_link',
+					postdata
+				).then(e => {
+					uni.hideLoading();
+					if (e.code != 0) {
+						return;
+					}
+					this.oncopy(e.data.info.longTpwd);
+				}).catch(function(err) {
+					console.log(err);
+				})
+			},
+			recordClick(goodsid,plat,title,act_price)
+			{
+				let postdata={
+					goodsid:goodsid,
+					plat:plat,
+					title:title,
+					act_price:act_price
+				}
+				this.$http.post('/api/activity/recordItemClick',
+					postdata
+				).then(e => {
+					
+				}).catch(function(err) {
+					console.log(err);
+				})
+			}
+		},
+	}
+</script>
+
+<style>
+	.item-price-prc {
+		color: #fe3a3f;
+		font-size: 1.2rem;
+		margin-right: 0.4rem;
+		font-weight: 500;
+	}
+
+	.cop-txt {
+		padding: 0.1rem;
+	}
+
+	.cop-money {
+		display: flex;
+		align-items: center;
+		height: 100%;
+		font-weight: 400;
+		color: #ff4d42;
+		background: #fff;
+		padding: 0.1rem;
+	}
+
+	.cop-con {
+		display: inline-flex;
+		background: linear-gradient(0deg, #ff753c, #ff4b42);
+		color: #fff;
+		padding: 0.05rem;
+		font-size: 0.9rem;
+
+	}
+
+	.item-v {
+		display: flex;
+		justify-content: space-between;
+		padding: 0.5rem;
+		background: #fff;
+		border-radius: 0.3rem;
+		width: 92%;
+		margin: 0 auto;
+		margin-bottom: 0.3rem;
+	}
+
+	.item-img {
+		width: 20%;
+	}
+
+	.item-img image {
+		width: 6rem;
+		height: 6rem;
+	}
+
+	.item-txt {
+		width: 71%;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+	}
+
+	.item-txt image {
+		width: 1.6rem;
+		height: 0.9rem;
+	}
+
+	.item-txt-title {
+		font-size: 0.9rem;
+		margin-left: 0.3rem;
+		text-overflow: -o-ellipsis-lastline;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		display: -webkit-box;
+		-webkit-line-clamp: 2;
+		line-clamp: 2;
+		-webkit-box-orient: vertical;
+		width: 90%;
+	}
+
+	.item-price {
+		display: flex;
+		font-size: 0.8rem;
+		align-items: baseline;
+		color: #8d8484;
+	}
+
+	.item-bottom {
+		display: flex;
+		justify-content: space-between;
+	}
+
+	.item-copy {
+		width: 5.92rem;
+		height: 1.66rem;
+		background: linear-gradient(-90deg, #fe3a3f, #faa450);
+		font-size: 0.9rem;
+		font-weight: 500;
+		color: #fffefd;
+		line-height: 1.66rem;
+		text-align: center;
+		border: 0;
+		outline: 0;
+		float: right;
+		border-radius: 1rem;
+	}
+</style>
\ No newline at end of file
diff --git a/h5/apph5/pages.json b/h5/apph5/pages.json
index 1642252..a2bb6e9 100644
--- a/h5/apph5/pages.json
+++ b/h5/apph5/pages.json
@@ -25,7 +25,7 @@
 			"path": "pages/wxkf/index",
 			"style": {
 				"navigationStyle":"custom",//涓嶆樉绀哄ご閮�
-				"navigationBarTitleText": "寰俊瀹㈡湇"
+				"navigationBarTitleText": "鑷冲皧VIP绂忓埄"
 			}
 		},
 		{
diff --git a/h5/apph5/pages/wxkf/index.vue b/h5/apph5/pages/wxkf/index.vue
index e1e9200..7e644c5 100644
--- a/h5/apph5/pages/wxkf/index.vue
+++ b/h5/apph5/pages/wxkf/index.vue
@@ -1,53 +1,121 @@
 <template>
-	<view class="main-cont">
-		<view class="txt-sty" style="margin-top: 4rem;">
-			<image class="head-img" :src="wxhead"></image>
+	<view>
+		<view class="main-cont">
+			<view class="txt-sty">
+				<image class="head-img" :src="wxhead"></image>
+			</view>
+			<view class="txt-sty head-txt">
+				寰俊鍙凤細{{wxtxt}}
+			</view>
+			<view class="txt-sty">
+				<image :src="wxImg" class="ercode-img"></image>
+			</view>
+			<view class="txt-sty" style="font-weight: 700; margin-top: 1rem;">闀挎寜浜岀淮鐮侊紝娣诲姞寰俊浜彈浼樻儬</view>
 		</view>
-		<view class="txt-sty head-txt">
-			寰俊鍙凤細{{wxtxt}}
+		<view class="item-contant" v-if="itemsdata&&itemsdata.length>0">
+			<view class="item-head">
+				---- 濂界墿鎺ㄨ崘 ----
+			</view>
+			<view class="item-list">
+				<view class="item-v" v-for="item in itemsdata">
+					<lineItem :isrecord="isrecord" :items="item"></lineItem>
+				</view>
+			</view>
+			<view class="bottom-show">娣诲姞寰俊锛屼韩鍙楁洿澶氫紭鎯爚</view>
 		</view>
-		<view class="txt-sty">
-			<image :src="wxImg" class="ercode-img"></image>
-		</view>
-		<view class="txt-sty" style="font-weight: 700; margin-top: 1rem;">闀挎寜浜岀淮鐮侊紝娣诲姞寰俊浜彈浼樻儬</view>
+		
 	</view>
 </template>
 
 <script>
+	import lineItem from '../../components/items/LineItem.vue';
+	import comUtils from '../../utils/ComUtils.js'
 	export default {
+		components: {
+			lineItem
+		},
 		data() {
 			return {
-				wxImg: 'https://img.ushopvip.com/dfg/wxcode.png',
-				wxhead: 'https://img.ushopvip.com/dfg/dfgapplogo.png',
-				wxtxt: 'sedws22'
+				wxImg: 'https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/wxhead0801.png',
+				wxhead: 'https://yanfeiobpub.obs.cn-east-3.myhuaweicloud.com/dfg/wxheadimg0801.jpg',
+				wxtxt: '17396873080',
+				itemsdata: {},
+				isrecord:true
 			}
 		},
 		onLoad() {
-
+			let isshow=comUtils.getUrlPar('ishow');
+			if(isshow)
+			{
+				this.getItemsInfo();
+			}
 		},
 		methods: {
-
+			getItemsInfo() {
+				var that = this;
+				let postdata = {
+					page: 1,
+					pageSize: 20,
+					sort: 7
+				};
+				this.$http.post('/api/taoke/tb_goods_list', 
+					postdata
+				).then(e => {
+					uni.hideLoading();
+					if (e.code != 0) {
+						return;
+					}
+					this.itemsdata = e.data.list;
+					console.log(e);
+				}).catch(function(err) {
+					console.log(err);
+				})
+			}
 
 		},
 	}
 </script>
 
 <style>
-	.txt-sty{
+	.item-head {
+		text-align: center;
+		padding: 1rem;
+		font-weight: 600;
+		color: linear-gradient(-90deg, #fe3a3f, #faa450);
+		color: #fe3a3f;
+		background: linear-gradient(-90deg, #fe3a3f, #faa450);
+		-webkit-background-clip: text;
+		-webkit-text-fill-color: transparent;
+	}
+
+	.bottom-show {
+		text-align: center;
+		width: 100%;
+		padding-bottom: 1rem;
+		color: #fe3a3f;
+		background: linear-gradient(-90deg, #fe3a3f, #faa450);
+		-webkit-background-clip: text;
+		-webkit-text-fill-color: transparent;
+		font-weight: 600;
+	}
+
+	.txt-sty {
 		text-align: center;
 	}
-	.main-cont {
-		
-	}
-	.head-txt{
+
+	.main-cont {}
+
+	.head-txt {
 		margin: 0.4rem 0 2rem 0;
 	}
 
 	.head-img {
 		width: 5rem;
 		height: 5rem;
+		margin-top: 4rem;
 	}
-	.ercode-img{
+
+	.ercode-img {
 		width: 16rem;
 		height: 16rem;
 	}
diff --git a/h5/apph5/request/api.js b/h5/apph5/request/api.js
index f7e443d..a160c27 100644
--- a/h5/apph5/request/api.js
+++ b/h5/apph5/request/api.js
@@ -30,6 +30,7 @@
 		})
 	}
 	let userToken=comUtils.getUrlPar("dfgtoken");
+	userToken=userToken?userToken:'3p6FrbNa+gAPubHGOK35mA==';
 	enstr="dfg"+enstr+"apph5"+userToken;
 	enstr=md5.hex_md5(enstr);
 	enstr+='.'+userToken

--
Gitblit v1.9.3